/* Generated by Cython 0.29.14 */

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

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

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

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


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

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

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


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

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


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

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


/*--- Type declarations ---*/
struct __pyx_obj_7pyarrow_3lib_Message;
struct __pyx_obj_7pyarrow_3lib_MemoryPool;
struct __pyx_obj_7pyarrow_3lib_DataType;
struct __pyx_obj_7pyarrow_3lib_ListType;
struct __pyx_obj_7pyarrow_3lib_StructType;
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_ScalarValue;
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__PandasConvertible;
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__CRecordBatchWriter;
struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader;
struct __pyx_obj_7pyarrow_3lib__PandasAPIShim;
struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool;
struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool;
struct __pyx_obj_7pyarrow_3lib_UnionType;
struct __pyx_obj_7pyarrow_3lib_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_UInt8Scalar;
struct __pyx_obj_7pyarrow_3lib_Int8Scalar;
struct __pyx_obj_7pyarrow_3lib_UInt16Scalar;
struct __pyx_obj_7pyarrow_3lib_Int16Scalar;
struct __pyx_obj_7pyarrow_3lib_UInt32Scalar;
struct __pyx_obj_7pyarrow_3lib_Int32Scalar;
struct __pyx_obj_7pyarrow_3lib_UInt64Scalar;
struct __pyx_obj_7pyarrow_3lib_Int64Scalar;
struct __pyx_obj_7pyarrow_3lib_FloatScalar;
struct __pyx_obj_7pyarrow_3lib_DoubleScalar;
struct __pyx_obj_7pyarrow_3lib__FunctionContext;
struct __pyx_obj_7pyarrow_3lib_Date32Array;
struct __pyx_obj_7pyarrow_3lib_Date64Array;
struct __pyx_obj_7pyarrow_3lib_TimestampArray;
struct __pyx_obj_7pyarrow_3lib_Time32Array;
struct __pyx_obj_7pyarrow_3lib_Time64Array;
struct __pyx_obj_7pyarrow_3lib_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_CompressedInputStream;
struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream;
struct __pyx_obj_7pyarrow_3lib_BufferedInputStream;
struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream;
struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem;
struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny;
struct __pyx_obj_7pyarrow_3lib_HdfsFile;
struct __pyx_obj_7pyarrow_3lib_MessageReader;
struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter;
struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader;
struct __pyx_obj_7pyarrow_3lib__RecordBatchFileWriter;
struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader;
struct __pyx_obj_7pyarrow_3lib_FeatherWriter;
struct __pyx_obj_7pyarrow_3lib_FeatherReader;
struct __pyx_obj_7pyarrow_3lib_SerializationContext;
struct __pyx_obj_7pyarrow_3lib_SerializedPyObject;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions;
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___iter__;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7_iterchunks;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_itercolumns;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_download;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_upload;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11___iter__;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12___iter__;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13_is_named_tuple;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_genexpr;
struct __pyx_opt_args_7pyarrow_3lib_ensure_type;
struct __pyx_opt_args_7pyarrow_3lib_14_PandasAPIShim__check_import;
struct __pyx_opt_args_7pyarrow_3lib_decimal128;
struct __pyx_opt_args_7pyarrow_3lib_dictionary;

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

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

/* "pyarrow/types.pxi":87
 * # 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":1349
 * 
 * 
 * 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":1431
 * 
 * 
 * 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":34
 * 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":39
 * 
 * 
 * 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":49
 * 
 * 
 * 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":59
 * 
 * 
 * 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":64
 * 
 * 
 * cdef class StructType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CStructType* struct_type
 */
struct __pyx_obj_7pyarrow_3lib_StructType {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
   arrow::StructType const *struct_type;
};


/* "pyarrow/lib.pxd":72
 * 
 * 
 * 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":77
 * 
 * 
 * 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":82
 * 
 * 
 * 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":87
 * 
 * 
 * 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":92
 * 
 * 
 * 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":97
 * 
 * 
 * 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":102
 * 
 * 
 * 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":113
 * 
 * 
 * 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":122
 * 
 * 
 * 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":127
 * 
 * 
 * cdef class NAType(Scalar):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_NAType {
  struct __pyx_obj_7pyarrow_3lib_Scalar __pyx_base;
};


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


/* "pyarrow/lib.pxd":307
 * 
 * 
 * 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":318
 * 
 * 
 * cdef class ChunkedArray(_PandasConvertible):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CChunkedArray] sp_chunked_array
 */
struct __pyx_obj_7pyarrow_3lib_ChunkedArray {
  struct __pyx_obj_7pyarrow_3lib__PandasConvertible __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_ChunkedArray *__pyx_vtab;
  std::shared_ptr< arrow::ChunkedArray>  sp_chunked_array;
   arrow::ChunkedArray *chunked_array;
};


/* "pyarrow/lib.pxd":327
 * 
 * 
 * cdef class Column(_PandasConvertible):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CColumn] sp_column
 */
struct __pyx_obj_7pyarrow_3lib_Column {
  struct __pyx_obj_7pyarrow_3lib__PandasConvertible __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_Column *__pyx_vtab;
  std::shared_ptr< arrow::Column>  sp_column;
   arrow::Column *column;
};


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


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


/* "pyarrow/lib.pxd":352
 * 
 * 
 * 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":362
 * 
 * 
 * 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":367
 * 
 * 
 * cdef class NativeFile:             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[InputStream] input_stream
 */
struct __pyx_obj_7pyarrow_3lib_NativeFile {
  PyObject_HEAD
  struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *__pyx_vtab;
  std::shared_ptr<arrow::io::InputStream>  input_stream;
  std::shared_ptr<arrow::io::RandomAccessFile>  random_access;
  std::shared_ptr<arrow::io::OutputStream>  output_stream;
  int is_readable;
  int is_writable;
  int is_seekable;
  int own_file;
  PyObject *__weakref__;
};


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


/* "pyarrow/array.pxi":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":947
 * 
 * 
 * cdef class Date32Array(NumericArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of date32 data type.
 */
struct __pyx_obj_7pyarrow_3lib_Date32Array {
  struct __pyx_obj_7pyarrow_3lib_NumericArray __pyx_base;
};


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


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


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


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


/* "pyarrow/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":571
 * 
 * 
 * cdef class PythonFile(NativeFile):             # <<<<<<<<<<<<<<
 *     """
 *     A stream backed by a Python file object.
 */
struct __pyx_obj_7pyarrow_3lib_PythonFile {
  struct __pyx_obj_7pyarrow_3lib_NativeFile __pyx_base;
  PyObject *handle;
};


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


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


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


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


/* "pyarrow/io.pxi":1104
 * 
 * 
 * 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.pxi":1122
 * 
 * 
 * cdef class CompressedInputStream(NativeFile):             # <<<<<<<<<<<<<<
 *     """
 *     An input stream wrapper which decompresses data on the fly.
 */
struct __pyx_obj_7pyarrow_3lib_CompressedInputStream {
  struct __pyx_obj_7pyarrow_3lib_NativeFile __pyx_base;
};


/* "pyarrow/io.pxi":1152
 * 
 * 
 * cdef class CompressedOutputStream(NativeFile):             # <<<<<<<<<<<<<<
 *     """
 *     An output stream wrapper which compresses data on the fly.
 */
struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream {
  struct __pyx_obj_7pyarrow_3lib_NativeFile __pyx_base;
};


/* "pyarrow/io.pxi":1183
 * 
 * 
 * cdef class BufferedInputStream(NativeFile):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, NativeFile stream, int buffer_size,
 */
struct __pyx_obj_7pyarrow_3lib_BufferedInputStream {
  struct __pyx_obj_7pyarrow_3lib_NativeFile __pyx_base;
};


/* "pyarrow/io.pxi":1199
 * 
 * 
 * cdef class BufferedOutputStream(NativeFile):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, NativeFile stream, int buffer_size,
 */
struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream {
  struct __pyx_obj_7pyarrow_3lib_NativeFile __pyx_base;
};


/* "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":466
 * # decref'd which can cause the client to get closed first if the file has the
 * # last remaining reference
 * cdef class _HdfsFileNanny:             # <<<<<<<<<<<<<<
 *     cdef:
 *         object client
 */
struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny {
  PyObject_HEAD
  PyObject *client;
  PyObject *file_handle_ref;
};


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


/* "pyarrow/ipc.pxi":101
 * 
 * 
 * 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":220
 * 
 * 
 * cdef class _RecordBatchStreamWriter(_CRecordBatchWriter):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[OutputStream] sink
 */
struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter {
  struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter __pyx_base;
  std::shared_ptr<arrow::io::OutputStream>  sink;
  int closed;
};


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


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


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


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


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


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


/* "pyarrow/serialization.pxi":232
 * 
 * 
 * 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":269
 *         return self.type.num_children()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over struct fields, in order.
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ {
  PyObject_HEAD
  Py_ssize_t __pyx_v_i;
  struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self;
  Py_ssize_t __pyx_t_0;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
};


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


/* "pyarrow/types.pxi":614
 *         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":290
 * cdef c_bool _datetime_conversion_initialized = False
 * 
 * cdef _datetime_conversion_functions():             # <<<<<<<<<<<<<<
 *     global _datetime_conversion_initialized
 *     if _datetime_conversion_initialized:
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions {
  PyObject_HEAD
  PyObject *__pyx_v_pd;
};


/* "pyarrow/scalar.pxi":479
 *         return self.getitem(_normalize_index(i, self.length()))
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over this element's values.
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4___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":592
 *         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_5___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":84
 *         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_6___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":250
 *         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_7_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":1385
 *         return self.column(index)
 * 
 *     def itercolumns(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterator over all columns in their numerical order
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_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":429
 *             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_9_download {
  PyObject_HEAD
  PyObject *__pyx_v_cleanup;
  int __pyx_v_done;
  PyObject *__pyx_v_stream;
  PyObject *__pyx_v_write_queue;
};


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


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


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


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


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



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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


/* "pyarrow/types.pxi":598
 * 
 * 
 * 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":53
 * 
 * 
 * cdef class ArrayValue(Scalar):             # <<<<<<<<<<<<<<
 *     """
 *     The base class for non-null array elements.
 */

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


/* "pyarrow/table.pxi":349
 * 
 * 
 * cdef class Column(_PandasConvertible):             # <<<<<<<<<<<<<<
 *     """
 *     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":936
 * 
 * 
 * cdef class Table(_PandasConvertible):             # <<<<<<<<<<<<<<
 *     """
 *     A collection of top-level named, equal length Arrow arrays.
 */

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


/* "pyarrow/scalar.pxi":701
 *         return hash(self.as_py())
 * 
 * cdef class UInt8Scalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for uint8 scalars.
 */

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


/* "pyarrow/io.pxi":1069
 * 
 * 
 * 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":1093
 * 
 * 
 * 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":1104
 * 
 * 
 * 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.pxi":1122
 * 
 * 
 * cdef class CompressedInputStream(NativeFile):             # <<<<<<<<<<<<<<
 *     """
 *     An input stream wrapper which decompresses data on the fly.
 */

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


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

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


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

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


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

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


/* "pyarrow/io-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":485
 * 
 * 
 * cdef class HdfsFile(NativeFile):             # <<<<<<<<<<<<<<
 *     cdef readonly:
 *         int32_t buffer_size
 */

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* PyFloatBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyFloat_TrueDivideObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyFloat_TrueDivideObjC(op1, op2, floatval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceTrueDivide(op1, op2) : PyNumber_TrueDivide(op1, op2))
#endif

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* 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_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_uint8_t(uint8_t value);

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

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int8_t(int8_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 PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim__import_pandas(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, int __pyx_v_raise_); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, struct __pyx_opt_args_7pyarrow_3lib_14_PandasAPIShim__check_import *__pyx_optional_args); /* proto*/
static CYTHON_INLINE int __pyx_f_7pyarrow_3lib_14_PandasAPIShim__have_pandas_internal(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_infer_dtype(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_array_like(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_categorical(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_datetimetz(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_data_frame(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_series(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_7pyarrow_3lib_10MemoryPool_init(struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_self,  arrow::MemoryPool *__pyx_v_pool); /* proto*/
static void __pyx_f_7pyarrow_3lib_8DataType_init(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static struct __pyx_obj_7pyarrow_3lib_Field *__pyx_f_7pyarrow_3lib_8DataType_child(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self, int __pyx_v_i); /* proto*/
static void __pyx_f_7pyarrow_3lib_14DictionaryType_init(struct __pyx_obj_7pyarrow_3lib_DictionaryType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static void __pyx_f_7pyarrow_3lib_8ListType_init(struct __pyx_obj_7pyarrow_3lib_ListType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static void __pyx_f_7pyarrow_3lib_10StructType_init(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static struct __pyx_obj_7pyarrow_3lib_Field *__pyx_f_7pyarrow_3lib_10StructType_field(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self, int __pyx_v_i); /* proto*/
static struct __pyx_obj_7pyarrow_3lib_Field *__pyx_f_7pyarrow_3lib_10StructType_field_by_name(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self, PyObject *__pyx_v_name); /* proto*/
static void __pyx_f_7pyarrow_3lib_9UnionType_init(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static void __pyx_f_7pyarrow_3lib_13TimestampType_init(struct __pyx_obj_7pyarrow_3lib_TimestampType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static void __pyx_f_7pyarrow_3lib_10Time32Type_init(struct __pyx_obj_7pyarrow_3lib_Time32Type *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static void __pyx_f_7pyarrow_3lib_10Time64Type_init(struct __pyx_obj_7pyarrow_3lib_Time64Type *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static void __pyx_f_7pyarrow_3lib_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_11ScalarValue_init(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self, std::shared_ptr< arrow::Scalar>  const &__pyx_v_sp_scalar); /* proto*/
static void __pyx_f_7pyarrow_3lib_5Array_init(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array); /* proto*/
static int64_t __pyx_f_7pyarrow_3lib_5Array_length(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_5Array_getitem(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, int64_t __pyx_v_i); /* proto*/
static void __pyx_f_7pyarrow_3lib_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_set_random_access_file(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, std::shared_ptr<arrow::io::RandomAccessFile>  __pyx_v_handle); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_10NativeFile_set_input_stream(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, std::shared_ptr<arrow::io::InputStream>  __pyx_v_handle); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_10NativeFile_set_output_stream(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, std::shared_ptr<arrow::io::OutputStream>  __pyx_v_handle); /* proto*/
static std::shared_ptr<arrow::io::RandomAccessFile>  __pyx_f_7pyarrow_3lib_10NativeFile_get_random_access_file(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto*/
static std::shared_ptr<arrow::io::InputStream>  __pyx_f_7pyarrow_3lib_10NativeFile_get_input_stream(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto*/
static std::shared_ptr<arrow::io::OutputStream>  __pyx_f_7pyarrow_3lib_10NativeFile_get_output_stream(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_6OSFile__open_readable(struct __pyx_obj_7pyarrow_3lib_OSFile *__pyx_v_self, std::string __pyx_v_path,  arrow::MemoryPool *__pyx_v_pool); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_6OSFile__open_writable(struct __pyx_obj_7pyarrow_3lib_OSFile *__pyx_v_self, std::string __pyx_v_path); /* proto*/
static void __pyx_f_7pyarrow_3lib_6Buffer_init(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, std::shared_ptr< arrow::Buffer>  const &__pyx_v_buffer); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_6Buffer_getitem(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, int64_t __pyx_v_i); /* proto*/
static void __pyx_f_7pyarrow_3lib_15ResizableBuffer_init_rz(struct __pyx_obj_7pyarrow_3lib_ResizableBuffer *__pyx_v_self, std::shared_ptr< arrow::ResizableBuffer>  const &__pyx_v_buffer); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_16HadoopFileSystem__ensure_client(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_16HadoopFileSystem__path_info(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, arrow::io::HdfsPathInfo *__pyx_v_info); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_18SerializedPyObject__write_to(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self, arrow::io::OutputStream *__pyx_v_stream); /* proto*/

/* Module declarations from '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.utility' */

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

/* 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_StructType = 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_ScalarValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int8Value = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int64Value = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_ListValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_StructValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UnionValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_StringValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib__PandasConvertible = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Array = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Tensor = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_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__CRecordBatchWriter = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib__CRecordBatchReader = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib__PandasAPIShim = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_LoggingMemoryPool = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_ProxyMemoryPool = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UnionType = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_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_UInt8Scalar = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int8Scalar = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UInt16Scalar = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int16Scalar = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UInt32Scalar = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int32Scalar = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UInt64Scalar = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int64Scalar = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_FloatScalar = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_DoubleScalar = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib__FunctionContext = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Date32Array = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Date64Array = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_TimestampArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Time32Array = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Time64Array = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_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_CompressedInputStream = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_CompressedOutputStream = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_BufferedInputStream = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_BufferedOutputStream = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_HadoopFileSystem = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib__HdfsFileNanny = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_HdfsFile = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_MessageReader = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib__RecordBatchStreamWriter = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib__RecordBatchStreamReader = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib__RecordBatchFileWriter = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib__RecordBatchFileReader = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_FeatherWriter = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_FeatherReader = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_SerializationContext = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_SerializedPyObject = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct____iter__ = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_1___iter__ = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_2___iter__ = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions = 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___iter__ = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_7_iterchunks = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_8_itercolumns = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_9_download = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_10_upload = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_11___iter__ = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_12___iter__ = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_13_is_named_tuple = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_14_genexpr = 0;
static struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_7pyarrow_3lib_pandas_api = 0;
static struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_7pyarrow_3lib__default_memory_pool = 0;
static struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *__pyx_v_7pyarrow_3lib__logging_memory_pool = 0;
static PyObject *__pyx_v_7pyarrow_3lib__pandas_type_map = 0;
static PyObject *__pyx_v_7pyarrow_3lib__pep3118_type_map = 0;
static PyObject *__pyx_v_7pyarrow_3lib__type_cache = 0;
static PyObject *__pyx_v_7pyarrow_3lib_PRIMITIVE_TYPES = 0;
static PyObject *__pyx_v_7pyarrow_3lib__timestamp_type_cache = 0;
static PyObject *__pyx_v_7pyarrow_3lib__time_type_cache = 0;
static PyObject *__pyx_v_7pyarrow_3lib__type_aliases = 0;
static PyObject *__pyx_v_7pyarrow_3lib__DATETIME_CONVERSION_FUNCTIONS = 0;
static bool __pyx_v_7pyarrow_3lib__datetime_conversion_initialized;
static PyObject *__pyx_v_7pyarrow_3lib__array_value_classes = 0;
static PyObject *__pyx_v_7pyarrow_3lib__scalar_classes = 0;
static struct __pyx_obj_7pyarrow_3lib__FunctionContext *__pyx_v_7pyarrow_3lib__global_ctx = 0;
static PyObject *__pyx_v_7pyarrow_3lib__array_classes = 0;
static 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 struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_f_7pyarrow_3lib_ensure_type(PyObject *, struct __pyx_opt_args_7pyarrow_3lib_ensure_type *__pyx_optional_args); /*proto*/
static std::shared_ptr< arrow::KeyValueMetadata>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_metadata(PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_metadata(std::shared_ptr< arrow::KeyValueMetadata const >  const &); /*proto*/
__PYX_EXTERN_C PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_array(std::shared_ptr< arrow::Array>  const &); /*proto*/
__PYX_EXTERN_C PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array(std::shared_ptr< arrow::ChunkedArray>  const &); /*proto*/
__PYX_EXTERN_C PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_batch(std::shared_ptr< arrow::RecordBatch>  const &); /*proto*/
__PYX_EXTERN_C PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(std::shared_ptr< arrow::Buffer>  const &); /*proto*/
__PYX_EXTERN_C PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_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 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__datetime_conversion_functions(void); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__sequence_to_array(PyObject *, PyObject *, PyObject *, struct __pyx_obj_7pyarrow_3lib_DataType *,  arrow::MemoryPool *, bool); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7pyarrow_3lib__is_array_like(PyObject *); /*proto*/
static std::shared_ptr< arrow::DataType>  __pyx_f_7pyarrow_3lib__ndarray_to_type(PyObject *, struct __pyx_obj_7pyarrow_3lib_DataType *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__ndarray_to_array(PyObject *, PyObject *, struct __pyx_obj_7pyarrow_3lib_DataType *, bool, bool,  arrow::MemoryPool *); /*proto*/
static 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 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 struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_f_7pyarrow_3lib__get_native_file(PyObject *, bool); /*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*/
static int __pyx_f_7pyarrow_3lib_pyarrow_is_buffer(PyObject *); /*proto*/
static int __pyx_f_7pyarrow_3lib_pyarrow_is_data_type(PyObject *); /*proto*/
static int __pyx_f_7pyarrow_3lib_pyarrow_is_field(PyObject *); /*proto*/
static int __pyx_f_7pyarrow_3lib_pyarrow_is_schema(PyObject *); /*proto*/
static int __pyx_f_7pyarrow_3lib_pyarrow_is_array(PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_scalar(std::shared_ptr< arrow::Scalar>  const &); /*proto*/
static int __pyx_f_7pyarrow_3lib_pyarrow_is_tensor(PyObject *); /*proto*/
static int __pyx_f_7pyarrow_3lib_pyarrow_is_column(PyObject *); /*proto*/
static int __pyx_f_7pyarrow_3lib_pyarrow_is_table(PyObject *); /*proto*/
static int __pyx_f_7pyarrow_3lib_pyarrow_is_batch(PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib___pyx_unpickle__PandasAPIShim__set_state(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib___pyx_unpickle_Scalar__set_state(struct __pyx_obj_7pyarrow_3lib_Scalar *, PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib___pyx_unpickle__PandasConvertible__set_state(struct __pyx_obj_7pyarrow_3lib__PandasConvertible *, PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib___pyx_unpickle_SerializationContext__set_state(struct __pyx_obj_7pyarrow_3lib_SerializationContext *, PyObject *); /*proto*/
static 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_vector_to_py_uint8_t(const std::vector<uint8_t>  &); /*proto*/
static PyObject *__pyx_convert_vector_to_py_int64_t(const std::vector<int64_t>  &); /*proto*/
static std::unordered_set<std::string>  __pyx_convert_unordered_set_from_py_std_3a__3a_string(PyObject *); /*proto*/
static std::unordered_map<std::string,std::string>  __pyx_convert_unordered_map_from_py_std_3a__3a_string__and_std_3a__3a_string(PyObject *); /*proto*/
static std::vector<std::string>  __pyx_convert_vector_from_py_std_3a__3a_string(PyObject *); /*proto*/
#define __Pyx_MODULE_NAME "pyarrow.lib"
extern int __pyx_module_is_main_pyarrow__lib;
int __pyx_module_is_main_pyarrow__lib = 0;

/* Implementation of 'pyarrow.lib' */
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_MemoryError;
static PyObject *__pyx_builtin_IOError;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_staticmethod;
static PyObject *__pyx_builtin_ImportError;
static PyObject *__pyx_builtin_AttributeError;
static PyObject *__pyx_builtin_NotImplemented;
static PyObject *__pyx_builtin_UserWarning;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_zip;
static PyObject *__pyx_builtin_map;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_super;
static PyObject *__pyx_builtin_StopIteration;
static PyObject *__pyx_builtin_object;
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_open;
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__2[] = "*";
static const char __pyx_k__9[] = "=";
static const char __pyx_k_ab[] = "ab";
static const char __pyx_k_ad[] = "ad";
static const char __pyx_k_df[] = "df";
static const char __pyx_k_dt[] = "dt";
static const char __pyx_k_f2[] = "f2";
static const char __pyx_k_f4[] = "f4";
static const char __pyx_k_f8[] = "f8";
static const char __pyx_k_gz[] = ".gz";
static const char __pyx_k_i1[] = "i1";
static const char __pyx_k_i2[] = "i2";
static const char __pyx_k_i4[] = "i4";
static const char __pyx_k_i8[] = "i8";
static const char __pyx_k_id[] = "id";
static const char __pyx_k_io[] = "io";
static const char __pyx_k_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_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_PY3[] = "PY3";
static const char __pyx_k__17[] = "+";
static const char __pyx_k__18[] = "-";
static const char __pyx_k_add[] = "add";
static const char __pyx_k_api[] = "api";
static const char __pyx_k_arr[] = "arr";
static const char __pyx_k_buf[] = "buf";
static const char __pyx_k_bz2[] = "bz2";
static const char __pyx_k_cat[] = "cat";
static const char __pyx_k_cls[] = "cls";
static const char __pyx_k_col[] = "col";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_get[] = "get";
static const char __pyx_k_key[] = "key";
static const char __pyx_k_lib[] = "lib";
static const char __pyx_k_lz4[] = "lz4";
static const char __pyx_k_map[] = "map";
static const char __pyx_k_mro[] = "__mro__";
static const char __pyx_k_nan[] = "nan";
static const char __pyx_k_new[] = "__new__";
static const char __pyx_k_obj[] = "obj";
static const char __pyx_k_out[] = "out";
static const char __pyx_k_pop[] = "pop";
static const char __pyx_k_pos[] = "pos";
static const char __pyx_k_r_2[] = "r+";
static const char __pyx_k_r_b[] = "r+b";
static const char __pyx_k_ref[] = "ref";
static const char __pyx_k_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_zst[] = ".zst";
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__136[] = "\n{}";
static const char __pyx_k__149[] = "";
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_core[] = "core";
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_keys[] = "keys";
static const char __pyx_k_kind[] = "kind";
static const char __pyx_k_list[] = "list_";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_mask[] = "mask";
static const char __pyx_k_mmap[] = "mmap";
static const char __pyx_k_mode[] = "mode";
static const char __pyx_k_name[] = "__name__";
static const char __pyx_k_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_util[] = "util";
static const char __pyx_k_warn[] = "warn";
static const char __pyx_k_zone[] = "zone";
static const char __pyx_k_zstd[] = "zstd";
static const char __pyx_k_Array[] = "Array";
static const char __pyx_k_Empty[] = "Empty";
static const char __pyx_k_Field[] = "Field";
static const char __pyx_k_Index[] = "Index";
static const char __pyx_k_Queue[] = "Queue";
static const char __pyx_k_Table[] = "Table";
static const char __pyx_k_alias[] = "alias";
static const char __pyx_k_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_bz2_2[] = ".bz2";
static const char __pyx_k_c_buf[] = "c_buf";
static const char __pyx_k_child[] = "child";
static const char __pyx_k_chunk[] = "chunk";
static const char __pyx_k_class[] = "__class__";
static const char __pyx_k_close[] = "close";
static const char __pyx_k_codec[] = "codec";
static const char __pyx_k_codes[] = "codes";
static const char __pyx_k_count[] = "count";
static const char __pyx_k_cpool[] = "cpool";
static const char __pyx_k_dense[] = "dense";
static const char __pyx_k_dtype[] = "dtype";
static const char __pyx_k_dumps[] = "dumps";
static const char __pyx_k_enter[] = "__enter__";
static const char __pyx_k_field[] = "field";
static const char __pyx_k_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_lz4_2[] = ".lz4";
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_0_19_0[] = "0.19.0";
static const char __pyx_k_0_20_0[] = "0.20.0";
static const char __pyx_k_Buffer[] = "Buffer";
static const char __pyx_k_Column[] = "Column";
static const char __pyx_k_IOBase[] = "IOBase";
static const char __pyx_k_NAType[] = "NAType";
static const char __pyx_k_NULL_2[] = "_NULL";
static const char __pyx_k_OSFile[] = "OSFile";
static const char __pyx_k_Scalar[] = "Scalar";
static const char __pyx_k_Schema[] = "Schema";
static const char __pyx_k_Series[] = "Series";
static const char __pyx_k_Tensor[] = "Tensor";
static const char __pyx_k_Thread[] = "Thread";
static const char __pyx_k_append[] = "append";
static const char __pyx_k_arrays[] = "arrays";
static const char __pyx_k_astype[] = "astype";
static const char __pyx_k_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_closed[] = "closed";
static const char __pyx_k_column[] = "column";
static const char __pyx_k_common[] = "common";
static const char __pyx_k_compat[] = "compat";
static const char __pyx_k_create[] = "create";
static const char __pyx_k_date32[] = "date32";
static const char __pyx_k_date64[] = "date64";
static const char __pyx_k_decode[] = "decode";
static const char __pyx_k_detect[] = "detect";
static const char __pyx_k_double[] = "double";
static const char __pyx_k_driver[] = "driver";
static const char __pyx_k_enable[] = "enable";
static const char __pyx_k_equals[] = "equals";
static const char __pyx_k_exc_tb[] = "exc_tb";
static const char __pyx_k_fields[] = "fields";
static const char __pyx_k_format[] = "format";
static const char __pyx_k_handle[] = "handle";
static const char __pyx_k_hdfs_d[] = "hdfs://(.*):(\\d+)(.*)";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_indent[] = "indent";
static const char __pyx_k_insert[] = "insert";
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_skipna[] = "skipna";
static const char __pyx_k_snappy[] = "snappy";
static const char __pyx_k_source[] = "source";
static const char __pyx_k_sparse[] = "sparse";
static const char __pyx_k_stream[] = "stream";
static const char __pyx_k_string[] = "string";
static const char __pyx_k_struct[] = "struct";
static const char __pyx_k_tables[] = "tables";
static const char __pyx_k_target[] = "target";
static const char __pyx_k_tensor[] = "tensor";
static const char __pyx_k_time32[] = "time32";
static const char __pyx_k_time64[] = "time64";
static const char __pyx_k_type_2[] = "type ";
static const char __pyx_k_type_3[] = "type_";
static const char __pyx_k_type_4[] = "_type";
static const char __pyx_k_tzinfo[] = "tzinfo";
static const char __pyx_k_uint16[] = "uint16";
static const char __pyx_k_uint32[] = "uint32";
static const char __pyx_k_uint64[] = "uint64";
static const char __pyx_k_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_boolean[] = "boolean";
static const char __pyx_k_buffers[] = "buffers";
static const char __pyx_k_c_array[] = "c_array";
static const char __pyx_k_c_codec[] = "c_codec";
static const char __pyx_k_c_table[] = "c_table";
static const char __pyx_k_cleanup[] = "cleanup";
static const char __pyx_k_columns[] = "columns";
static const char __pyx_k_compile[] = "compile";
static const char __pyx_k_connect[] = "connect";
static const char __pyx_k_context[] = "context";
static const char __pyx_k_ctensor[] = "ctensor";
static const char __pyx_k_decimal[] = "decimal";
static const char __pyx_k_exc_val[] = "exc_val";
static const char __pyx_k_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_rd_file[] = "rd_file";
static const char __pyx_k_replace[] = "replace";
static const char __pyx_k_seconds[] = "seconds";
static const char __pyx_k_testing[] = "testing";
static const char __pyx_k_timeout[] = "timeout";
static const char __pyx_k_tobytes[] = "tobytes";
static const char __pyx_k_type_id[] = "type_id";
static const char __pyx_k_version[] = "__version__";
static const char __pyx_k_weakref[] = "weakref";
static const char __pyx_k_DataType[] = "DataType";
static const char __pyx_k_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_endswith[] = "endswith";
static const char __pyx_k_exc_info[] = "exc_info";
static const char __pyx_k_exc_type[] = "exc_type";
static const char __pyx_k_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_position[] = "position";
static const char __pyx_k_py_field[] = "py_field";
static const char __pyx_k_pyx_type[] = "__pyx_type";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_readable[] = "readable";
static const char __pyx_k_readline[] = "readline";
static const char __pyx_k_register[] = "register";
static const char __pyx_k_setstate[] = "__setstate__";
static const char __pyx_k_time32_s[] = "time32[s]";
static const char __pyx_k_timezone[] = "timezone";
static const char __pyx_k_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_file_type[] = "file_type";
static const char __pyx_k_frombytes[] = "frombytes";
static const char __pyx_k_full_info[] = "full_info";
static const char __pyx_k_get_batch[] = "get_batch";
static const char __pyx_k_halffloat[] = "halffloat";
static const char __pyx_k_in_stream[] = "in_stream";
static const char __pyx_k_indices_2[] = "_indices";
static const char __pyx_k_is_series[] = "is_series";
static const char __pyx_k_iteritems[] = "iteritems";
static const char __pyx_k_metaclass[] = "__metaclass__";
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_utcoffset[] = "utcoffset";
static const char __pyx_k_ArrayValue[] = "ArrayValue";
static const char __pyx_k_BaseTzInfo[] = "BaseTzInfo";
static const char __pyx_k_FloatArray[] = "FloatArray";
static const char __pyx_k_FloatValue[] = "FloatValue";
static const char __pyx_k_IndexError[] = "IndexError";
static const char __pyx_k_Int16Array[] = "Int16Array";
static const char __pyx_k_Int16Value[] = "Int16Value";
static const char __pyx_k_Int32Array[] = "Int32Array";
static const char __pyx_k_Int32Value[] = "Int32Value";
static const char __pyx_k_Int64Array[] = "Int64Array";
static const char __pyx_k_Int64Value[] = "Int64Value";
static const char __pyx_k_Int8Scalar[] = "Int8Scalar";
static const char __pyx_k_MemoryPool[] = "MemoryPool";
static const char __pyx_k_NativeFile[] = "NativeFile";
static const char __pyx_k_PythonFile[] = "PythonFile";
static const char __pyx_k_QueueEmpty[] = "QueueEmpty";
static const char __pyx_k_StructType[] = "StructType";
static const char __pyx_k_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_data_frame[] = "data_frame";
static const char __pyx_k_date32_day[] = "date32[day]";
static const char __pyx_k_decimal128[] = "decimal128";
static const char __pyx_k_decompress[] = "decompress";
static const char __pyx_k_dictionary[] = "dictionary";
static const char __pyx_k_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_memoryview[] = "memoryview";
static const char __pyx_k_metadata_2[] = "\nmetadata\n--------\n";
static const char __pyx_k_null_count[] = "null_count";
static const char __pyx_k_num_arrays[] = "num_arrays";
static const char __pyx_k_num_chunks[] = "num_chunks";
static const char __pyx_k_pandas_api[] = "_pandas_api";
static const char __pyx_k_put_nowait[] = "put_nowait";
static const char __pyx_k_pyx_result[] = "__pyx_result";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_result_obj[] = "result_obj";
static const char __pyx_k_serialized[] = "serialized";
static const char __pyx_k_serializer[] = "serializer";
static const char __pyx_k_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_FloatScalar[] = "FloatScalar";
static const char __pyx_k_ImportError[] = "ImportError";
static const char __pyx_k_Int16Scalar[] = "Int16Scalar";
static const char __pyx_k_Int32Scalar[] = "Int32Scalar";
static const char __pyx_k_Int64Scalar[] = "Int64Scalar";
static const char __pyx_k_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_ScalarValue[] = "ScalarValue";
static const char __pyx_k_StringArray[] = "StringArray";
static const char __pyx_k_StringValue[] = "StringValue";
static const char __pyx_k_StructArray[] = "StructArray";
static const char __pyx_k_StructValue[] = "StructValue";
static const char __pyx_k_SystemError[] = "SystemError";
static const char __pyx_k_Time32Array[] = "Time32Array";
static const char __pyx_k_Time32Value[] = "Time32Value";
static const char __pyx_k_Time64Array[] = "Time64Array";
static const char __pyx_k_Time64Value[] = "Time64Value";
static const char __pyx_k_Type_BINARY[] = "Type_BINARY";
static const char __pyx_k_Type_DATE32[] = "Type_DATE32";
static const char __pyx_k_Type_DATE64[] = "Type_DATE64";
static const char __pyx_k_Type_DOUBLE[] = "Type_DOUBLE";
static const char __pyx_k_Type_STRING[] = "Type_STRING";
static const char __pyx_k_Type_STRUCT[] = "Type_STRUCT";
static const char __pyx_k_Type_TIME32[] = "Type_TIME32";
static const char __pyx_k_Type_TIME64[] = "Type_TIME64";
static const char __pyx_k_Type_UINT16[] = "Type_UINT16";
static const char __pyx_k_Type_UINT32[] = "Type_UINT32";
static const char __pyx_k_Type_UINT64[] = "Type_UINT64";
static const char __pyx_k_UInt16Array[] = "UInt16Array";
static const char __pyx_k_UInt16Value[] = "UInt16Value";
static const char __pyx_k_UInt32Array[] = "UInt32Array";
static const char __pyx_k_UInt32Value[] = "UInt32Value";
static const char __pyx_k_UInt64Array[] = "UInt64Array";
static const char __pyx_k_UInt64Value[] = "UInt64Value";
static const char __pyx_k_UInt8Scalar[] = "UInt8Scalar";
static const char __pyx_k_UserWarning[] = "UserWarning";
static const char __pyx_k_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_compression[] = "compression";
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_have_pandas[] = "have_pandas";
static const char __pyx_k_index_value[] = "index_value";
static const char __pyx_k_infer_dtype[] = "infer_dtype";
static const char __pyx_k_itercolumns[] = "itercolumns";
static const char __pyx_k_kerb_ticket[] = "kerb_ticket";
static const char __pyx_k_make_series[] = "make_series";
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_source_path[] = "source_path";
static const char __pyx_k_struct_type[] = "struct_type";
static const char __pyx_k_target_type[] = "target_type";
static const char __pyx_k_timestamp_s[] = "timestamp[s]";
static const char __pyx_k_to_pandas_2[] = "to_pandas";
static const char __pyx_k_total_bytes[] = "total_bytes";
static const char __pyx_k_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_DoubleScalar[] = "DoubleScalar";
static const char __pyx_k_FeatherError[] = "FeatherError";
static const char __pyx_k_HDFS_PATH_RE[] = "_HDFS_PATH_RE";
static const char __pyx_k_IntegerArray[] = "IntegerArray";
static const char __pyx_k_LooseVersion[] = "LooseVersion";
static const char __pyx_k_NumericArray[] = "NumericArray";
static const char __pyx_k_PickleBuffer[] = "PickleBuffer";
static const char __pyx_k_Type_DECIMAL[] = "Type_DECIMAL";
static const char __pyx_k_UInt16Scalar[] = "UInt16Scalar";
static const char __pyx_k_UInt32Scalar[] = "UInt32Scalar";
static const char __pyx_k_UInt64Scalar[] = "UInt64Scalar";
static const char __pyx_k_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_input_stream[] = "input_stream";
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_ndarrays[] = "num_ndarrays";
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_FixedOffset_2[] = "FixedOffset";
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_PandasAPIShim[] = "_PandasAPIShim";
static const char __pyx_k_Schema___iter[] = "Schema.__iter__";
static const char __pyx_k_StopIteration[] = "StopIteration";
static const char __pyx_k_StringBuilder[] = "StringBuilder";
static const char __pyx_k_TimestampType[] = "TimestampType";
static const char __pyx_k_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_is_array_like[] = "is_array_like";
static const char __pyx_k_is_data_frame[] = "is_data_frame";
static const char __pyx_k_is_datetimetz[] = "is_datetimetz";
static const char __pyx_k_last_accessed[] = "last_accessed";
static const char __pyx_k_last_modified[] = "last_modified";
static const char __pyx_k_output_buffer[] = "output_buffer";
static const char __pyx_k_output_length[] = "output_length";
static const char __pyx_k_output_stream[] = "output_stream";
static const char __pyx_k_pa_getnewargs[] = "_pa_getnewargs_";
static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
static const char __pyx_k_remove_column[] = "remove_column";
static const char __pyx_k_restore_array[] = "_restore_array";
static const char __pyx_k_set_cpu_count[] = "set_cpu_count";
static const char __pyx_k_shrink_to_fit[] = "shrink_to_fit";
static const char __pyx_k_target_schema[] = "target_schema";
static const char __pyx_k_total_seconds[] = "total_seconds";
static const char __pyx_k_value_offsets[] = "value_offsets";
static const char __pyx_k_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_categorical[] = "is_categorical";
static const char __pyx_k_is_float_value[] = "is_float_value";
static const char __pyx_k_is_named_tuple[] = "is_named_tuple";
static const char __pyx_k_preserve_index[] = "preserve_index";
static const char __pyx_k_pyarrow_compat[] = "pyarrow.compat";
static const char __pyx_k_pyarrow_io_pxi[] = "pyarrow/io.pxi";
static const char __pyx_k_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_DatetimeTZDtype[] = "DatetimeTZDtype";
static const char __pyx_k_Decimal128Array[] = "Decimal128Array";
static const char __pyx_k_DictionaryArray[] = "DictionaryArray";
static const char __pyx_k_DictionaryValue[] = "DictionaryValue";
static const char __pyx_k_FIXED_OFFSET_RE[] = "_FIXED_OFFSET_RE";
static const char __pyx_k_FunctionContext[] = "_FunctionContext";
static const char __pyx_k_PlasmaStoreFull[] = "PlasmaStoreFull";
static const char __pyx_k_ProxyMemoryPool[] = "ProxyMemoryPool";
static const char __pyx_k_ResizableBuffer[] = "ResizableBuffer";
static const char __pyx_k_Scalar_was_NULL[] = "Scalar was NULL";
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_seekable[] = "_assert_seekable";
static const char __pyx_k_assert_writable[] = "_assert_writable";
static const char __pyx_k_children_fields[] = "children_fields";
static const char __pyx_k_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_ignore_metadata[] = "ignore_metadata";
static const char __pyx_k_make_datetimetz[] = "make_datetimetz";
static const char __pyx_k_max_output_size[] = "max_output_size";
static const char __pyx_k_metadata_length[] = "metadata_length";
static const char __pyx_k_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_categorical_type[] = "categorical_type";
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_pandas_api_types[] = "pandas.api.types";
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_PandasConvertible[] = "_PandasConvertible";
static const char __pyx_k_StructType___iter[] = "StructType.__iter__";
static const char __pyx_k_Table_itercolumns[] = "Table.itercolumns";
static const char __pyx_k_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_distutils_version[] = "distutils.version";
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_CRecordBatchReader[] = "_CRecordBatchReader";
static const char __pyx_k_CRecordBatchWriter[] = "_CRecordBatchWriter";
static const char __pyx_k_Column_r_not_found[] = "Column {!r} not found";
static const char __pyx_k_FloatingPointArray[] = "FloatingPointArray";
static const char __pyx_k_PlasmaObjectExists[] = "PlasmaObjectExists";
static const char __pyx_k_SerializedPyObject[] = "SerializedPyObject";
static const char __pyx_k_assert_frame_equal[] = "assert_frame_equal";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_dataframe_to_types[] = "dataframe_to_types";
static const char __pyx_k_default_block_size[] = "default_block_size";
static const char __pyx_k_detect_compression[] = "_detect_compression";
static const char __pyx_k_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_417[] = "Array.cast (line 417)";
static const char __pyx_k_BufferedInputStream[] = "BufferedInputStream";
static const char __pyx_k_ChunkedArray___iter[] = "ChunkedArray.__iter__";
static const char __pyx_k_DEFAULT_BUFFER_SIZE[] = "DEFAULT_BUFFER_SIZE";
static const char __pyx_k_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_deduplicate_objects[] = "deduplicate_objects";
static const char __pyx_k_default_memory_pool[] = "default_memory_pool";
static const char __pyx_k_get_datetimetz_type[] = "get_datetimetz_type";
static const char __pyx_k_get_default_context[] = "_get_default_context";
static const char __pyx_k_index_out_of_bounds[] = "index out of bounds";
static const char __pyx_k_logging_memory_pool[] = "logging_memory_pool";
static const char __pyx_k_pandas_types_dtypes[] = "pandas.types.dtypes";
static const char __pyx_k_pyarrow_io_hdfs_pxi[] = "pyarrow/io-hdfs.pxi";
static const char __pyx_k_pyx_unpickle_Scalar[] = "__pyx_unpickle_Scalar";
static const char __pyx_k_set_memcopy_threads[] = "set_memcopy_threads";
static const char __pyx_k_BufferedOutputStream[] = "BufferedOutputStream";
static const char __pyx_k_FixedSizeBinaryArray[] = "FixedSizeBinaryArray";
static const char __pyx_k_FixedSizeBinaryValue[] = "FixedSizeBinaryValue";
static const char __pyx_k_MessageReader___iter[] = "MessageReader.__iter__";
static const char __pyx_k_Non_fixed_width_type[] = "Non-fixed width type";
static const char __pyx_k_SerializationContext[] = "SerializationContext";
static const char __pyx_k_UnsupportedOperation[] = "UnsupportedOperation";
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_CompressedInputStream[] = "CompressedInputStream";
static const char __pyx_k_FixedSizeBufferWriter[] = "FixedSizeBufferWriter";
static const char __pyx_k_HDFS_client_is_closed[] = "HDFS client is closed";
static const char __pyx_k_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_ndarray_to_arrow_type[] = "_ndarray_to_arrow_type";
static const char __pyx_k_pyarrow_benchmark_pxi[] = "pyarrow/benchmark.pxi";
static const char __pyx_k_pyarrow_pandas_compat[] = "pyarrow.pandas_compat";
static const char __pyx_k_pyarrow_serialization[] = "pyarrow.serialization";
static const char __pyx_k_table_to_blockmanager[] = "table_to_blockmanager";
static const char __pyx_k_total_allocated_bytes[] = "total_allocated_bytes";
static const char __pyx_k_0___class_____name___0[] = "{0.__class__.__name__}({0})";
static const char __pyx_k_CompressedOutputStream[] = "CompressedOutputStream";
static const char __pyx_k_Invalid_union_mode_0_r[] = "Invalid union mode {0!r}";
static const char __pyx_k_Type_FIXED_SIZE_BINARY[] = "Type_FIXED_SIZE_BINARY";
static const char __pyx_k_deserialize_components[] = "deserialize_components";
static const char __pyx_k_fixed_offset_to_string[] = "fixed_offset_to_string";
static const char __pyx_k_fixed_size_binary_type[] = "fixed_size_binary_type";
static const char __pyx_k_log_memory_allocations[] = "log_memory_allocations";
static const char __pyx_k_readable_file_expected[] = "readable file expected";
static const char __pyx_k_strings_to_categorical[] = "strings_to_categorical";
static const char __pyx_k_upload_locals_bg_write[] = "upload.<locals>.bg_write";
static const char __pyx_k_writable_file_expected[] = "writable file expected";
static const char __pyx_k_ArrowSerializationError[] = "ArrowSerializationError";
static const char __pyx_k_ChunkedArray_iterchunks[] = "ChunkedArray.iterchunks";
static const char __pyx_k_DataType_expected_got_r[] = "DataType expected, got {!r}";
static const char __pyx_k_Invalid_TimeUnit_string[] = "Invalid TimeUnit string";
static const char __pyx_k_PlasmaObjectNonexistent[] = "PlasmaObjectNonexistent";
static const char __pyx_k_RecordBatchStreamReader[] = "_RecordBatchStreamReader";
static const char __pyx_k_RecordBatchStreamWriter[] = "_RecordBatchStreamWriter";
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_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_CRecordBatchReader___iter[] = "_CRecordBatchReader.__iter__";
static const char __pyx_k_Invalid_value_of_whence_0[] = "Invalid value of whence: {0}";
static const char __pyx_k_Scalar_data_type_was_NULL[] = "Scalar data type was NULL";
static const char __pyx_k_please_pass_it_explicitly[] = ", please pass it explicitly";
static const char __pyx_k_pyarrow_serialization_pxi[] = "pyarrow/serialization.pxi";
static const char __pyx_k_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_Offset_must_be_non_negative[] = "Offset must be non-negative";
static const char __pyx_k_Schema_from_pandas_line_720[] = "Schema.from_pandas (line 720)";
static const char __pyx_k_Table_from_pandas_line_1087[] = "Table.from_pandas (line 1087)";
static const char __pyx_k_Unsupported_type_for_column[] = "Unsupported type for column(...): {}";
static const char __pyx_k_default_context_initialized[] = "_default_context_initialized";
static const char __pyx_k_pyx_unpickle__PandasAPIShim[] = "__pyx_unpickle__PandasAPIShim";
static const char __pyx_k_DeserializationCallbackError[] = "DeserializationCallbackError";
static const char __pyx_k_I_O_operation_on_closed_file[] = "I/O operation on closed file";
static const char __pyx_k_Indices_must_be_integer_type[] = "Indices must be integer type";
static const char __pyx_k_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_seekable_files[] = "only valid on seekable files";
static const char __pyx_k_only_valid_on_writable_files[] = "only valid on writable files";
static const char __pyx_k_Cannot_pass_schema_and_arrays[] = "Cannot pass schema and arrays";
static const char __pyx_k_Unrecognized_compression_type[] = "Unrecognized compression type: {}";
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_pyx_unpickle__PandasConvertibl[] = "__pyx_unpickle__PandasConvertible";
static const char __pyx_k_Buffer_size_must_be_larger_than[] = "Buffer size must be larger than zero";
static const char __pyx_k_Cannot_compare_scalars_that_don[] = "Cannot compare scalars that don't support as_py()";
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_Invalid_value_for_compression_r[] = "Invalid value for compression: {!r}";
static const char __pyx_k_List_requires_DataType_or_Field[] = "List requires DataType or Field";
static const char __pyx_k_Metadata_must_be_an_instance_of[] = "Metadata must be an instance of dict";
static const char __pyx_k_Must_be_an_instance_of_datetime[] = "Must be an instance of `datetime.tzinfo`";
static const char __pyx_k_Must_pass_decompressed_size_for[] = "Must pass decompressed_size for {0} codec";
static const char __pyx_k_Returns_implied_schema_from_dat[] = "\n        Returns implied schema from dataframe\n\n        Parameters\n        ----------\n        df : pandas.DataFrame\n        preserve_index : bool, default True\n            Whether to store the index as an additional column (or columns, for\n            MultiIndex) in the resulting `Table`.\n\n        Returns\n        -------\n        pyarrow.Schema\n\n        Examples\n        --------\n\n        >>> import pandas as pd\n        >>> import pyarrow as pa\n        >>> df = pd.DataFrame({\n            ...     'int': [1, 2],\n            ...     'str': ['a', 'b']\n            ... })\n        >>> pa.Schema.from_pandas(df)\n        int: int64\n        str: string\n        __index_level_0__: int64\n        ";
static const char __pyx_k_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_We_do_not_know_how_to_serialize[] = "We do not know how to serialize the object '{}'";
static const char __pyx_k_datetime_conversion_functions_l[] = "_datetime_conversion_functions.<locals>.<lambda>";
static const char __pyx_k_mask_not_implemented_with_Arrow[] = "mask not implemented with Arrow array inputs yet";
static const char __pyx_k_not_registered_in_deserializati[] = " not registered in deserialization callback";
static const char __pyx_k_not_supported_for_buffer_protoc[] = " not supported for buffer protocol";
static const char __pyx_k_pyarrow_Message_type_0_metadata[] = "pyarrow.Message\ntype: {0}\nmetadata length: {1}\nbody length: {2}";
static const char __pyx_k_pyarrow_Tensor_type_0_type_shap[] = "<pyarrow.Tensor>\ntype: {0.type}\nshape: {0.shape}\nstrides: {0.strides}";
static const char __pyx_k_self_ap_self_sp_array_cannot_be[] = "self.ap,self.sp_array cannot be converted to a Python object for pickling";
static const char __pyx_k_self_client_cannot_be_converted[] = "self.client cannot be converted to a Python object for pickling";
static const char __pyx_k_self_reader_cannot_be_converted[] = "self.reader cannot be converted to a Python object for pickling";
static const char __pyx_k_self_writer_cannot_be_converted[] = "self.writer cannot be converted to a Python object for pickling";
static const char __pyx_k_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, use pyarrow.*_memory_pool instead.";
static const char __pyx_k_Expected_integer_or_string_index[] = "Expected integer or string index";
static const char __pyx_k_HDFS_client_improperly_initializ[] = "HDFS client improperly initialized";
static const char __pyx_k_Incompatible_checksums_s_vs_0x01[] = "Incompatible checksums (%s vs 0x019bb17 = (_array_like_types, _categorical_type, _compat_module, _data_frame, _datetimetz_type, _have_pandas, _index, _loose_version, _pd, _series, _tried_importing_pandas, _types_api, _version))";
static const char __pyx_k_Incompatible_checksums_s_vs_0x59[] = "Incompatible checksums (%s vs 0x599dcce = (type))";
static const char __pyx_k_Incompatible_checksums_s_vs_0x9a[] = "Incompatible checksums (%s vs 0x9aeed6f = (custom_deserializers, custom_serializers, pickle_deserializer, pickle_serializer, type_to_type_id, types_to_pickle, whitelisted_types))";
static const char __pyx_k_Incompatible_checksums_s_vs_0xd4[] = "Incompatible checksums (%s vs 0xd41d8cd = ())";
static const char __pyx_k_Index_must_either_be_string_or_i[] = "Index must either be string or integer";
static const char __pyx_k_Length_of_names_does_not_match_l[] = "Length of names ({}) does not match length of arrays ({})";
static const char __pyx_k_Mode_must_be_rb_read_wb_write_ne[] = "Mode must be 'rb' (read), 'wb' (write, new file), or 'ab' (append)";
static const char __pyx_k_Must_pass_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_Offset_must_represent_whole_numb[] = "Offset must represent whole number of minutes";
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_Schema_field_name_corresponds_to[] = "Schema field name corresponds to more than one field";
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_Struct_field_name_corresponds_to[] = "Struct field name corresponds to more than one field";
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_The_number_of_names_should_be_eq[] = "The number of names should be equal to the number of arrays";
static const char __pyx_k_The_type_id_argument_must_be_a_s[] = "The type_id argument must be a string. The value passed in has type {}.";
static const char __pyx_k_Unable_to_convert_timezone_to_st[] = "Unable to convert timezone `{}` to string";
static const char __pyx_k_Unable_to_read_from_object_of_ty[] = "Unable to read from object of type: {0}";
static const char __pyx_k_Unable_to_read_message_from_obje[] = "Unable to read message from object with type: {0}";
static const char __pyx_k_Unable_to_wrap_Datum_in_a_Python[] = "Unable to wrap Datum in a Python object";
static const char __pyx_k_Writable_buffer_requested_but_Ar[] = "Writable buffer requested but Arrow buffer was not mutable";
static const char __pyx_k_accessing_non_existent_buffer_se[] = "accessing non-existent buffer segment";
static const char __pyx_k_could_not_infer_open_mode_for_fi[] = "could not infer open mode for file-like object ";
static const char __pyx_k_field_or_tuple_expected_got_None[] = "field or tuple expected, got None";
static const char __pyx_k_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_pa_input_stream_called_with_inst[] = "pa.input_stream() called with instance of '{}'";
static const char __pyx_k_pa_output_stream_called_with_ins[] = "pa.output_stream() called with instance of '{}'";
static const char __pyx_k_precision_should_be_between_1_an[] = "precision should be between 1 and 38";
static const char __pyx_k_prior_column_had_a_different_num[] = "prior column had a different number of rows";
static const char __pyx_k_pyarrow_does_not_know_how_to_ser[] = "pyarrow does not know how to serialize objects of type {}.";
static const char __pyx_k_register_default_serialization_h[] = "register_default_serialization_handlers";
static const char __pyx_k_self_data_cannot_be_converted_to[] = "self.data cannot be converted to a Python object for pickling";
static const char __pyx_k_self_logging_pool_self_pool_cann[] = "self.logging_pool,self.pool cannot be converted to a Python object for pickling";
static const char __pyx_k_self_pool_cannot_be_converted_to[] = "self.pool cannot be converted to a Python object for pickling";
static const char __pyx_k_self_pool_self_proxy_pool_cannot[] = "self.pool,self.proxy_pool cannot be converted to a Python object for pickling";
static const char __pyx_k_self_sp_array_cannot_be_converte[] = "self.sp_array cannot be converted to a Python object for pickling";
static const char __pyx_k_self_sp_scalar_cannot_be_convert[] = "self.sp_scalar cannot be converted to a Python object for pickling";
static const char __pyx_k_self_sp_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_tzinfo_to_string_locals_fixed_of[] = "tzinfo_to_string.<locals>.fixed_offset_to_string";
static const char __pyx_k_Do_not_call_s_constructor_direct_2[] = "Do not call {}'s constructor directly, use pyarrow.logging_memory_pool instead.";
static const char __pyx_k_Do_not_call_s_constructor_direct_3[] = "Do not call {}'s constructor directly, use pyarrow.proxy_memory_pool instead.";
static const char __pyx_k_Do_not_call_s_constructor_direct_4[] = "Do not call {}'s constructor directly, use public functions like pyarrow.int64, pyarrow.list_, etc. instead.";
static const char __pyx_k_Do_not_call_s_constructor_direct_5[] = "Do not call {}'s constructor directly, use array subscription instead.";
static const char __pyx_k_Do_not_call_s_constructor_direct_6[] = "Do not call {}'s constructor directly.";
static const char __pyx_k_Do_not_call_s_constructor_direct_7[] = "Do not call {}'s constructor directly, use one of the `pyarrow.Array.from_*` functions instead.";
static const char __pyx_k_Do_not_call_s_constructor_direct_8[] = "Do not call {}'s constructor directly, use `pyarrow.ipc.read_message` function instead.";
static const char __pyx_k_Do_not_call_s_constructor_direct_9[] = "Do not call {}'s constructor directly, use `pyarrow.ipc.MessageReader.open_stream` function instead.";
static const char __pyx_k_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_No_value_specified_for_struct_at_6[] = "No value specified for struct attribute 'deduplicate_objects'";
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_u_02d_02d;
static PyObject *__pyx_kp_u_0_0_9_1_0_9_2_0_3_0_5_0_9;
static PyObject *__pyx_kp_u_0_1;
static PyObject *__pyx_kp_u_0_19_0;
static PyObject *__pyx_kp_u_0_20_0;
static PyObject *__pyx_kp_u_0___class_____name___0;
static PyObject *__pyx_kp_u_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_417;
static PyObject *__pyx_kp_u_Array_data_type_was_NULL;
static PyObject *__pyx_kp_u_Array_was_NULL;
static PyObject *__pyx_kp_u_Arrays_were_not_all_the_same_len;
static PyObject *__pyx_n_s_ArrowCapacityError;
static PyObject *__pyx_n_s_ArrowException;
static PyObject *__pyx_n_s_ArrowIOError;
static PyObject *__pyx_n_s_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_n_s_BaseTzInfo;
static PyObject *__pyx_kp_u_Batch_number_0_out_of_range;
static PyObject *__pyx_n_s_BinaryArray;
static PyObject *__pyx_n_s_BinaryValue;
static PyObject *__pyx_n_s_BooleanArray;
static PyObject *__pyx_n_s_BooleanValue;
static PyObject *__pyx_n_s_Buffer;
static PyObject *__pyx_n_s_BufferError;
static PyObject *__pyx_n_s_BufferOutputStream;
static PyObject *__pyx_n_s_BufferReader;
static PyObject *__pyx_kp_u_Buffer_size_must_be_larger_than;
static PyObject *__pyx_n_s_BufferedIOBase;
static PyObject *__pyx_n_s_BufferedInputStream;
static PyObject *__pyx_n_s_BufferedOutputStream;
static PyObject *__pyx_kp_u_CPU_count_must_be_strictly_posit;
static PyObject *__pyx_n_s_CRecordBatchReader;
static PyObject *__pyx_n_s_CRecordBatchReader___iter;
static PyObject *__pyx_n_s_CRecordBatchWriter;
static PyObject *__pyx_kp_u_Cannot_compare_Arrow_values_that;
static PyObject *__pyx_kp_u_Cannot_compare_scalars_that_don;
static PyObject *__pyx_kp_u_Cannot_construct_a_chunked_array;
static PyObject *__pyx_kp_u_Cannot_convert_nanosecond_timest;
static PyObject *__pyx_kp_u_Cannot_create_multiple_NAType_in;
static PyObject *__pyx_kp_u_Cannot_pass_schema_and_arrays;
static PyObject *__pyx_kp_u_Cast_array_values_to_another_da;
static PyObject *__pyx_n_s_Categorical;
static PyObject *__pyx_kp_u_Chunk_index_out_of_range;
static PyObject *__pyx_n_s_ChunkedArray;
static PyObject *__pyx_n_s_ChunkedArray___iter;
static PyObject *__pyx_kp_u_ChunkedArray_data_type_was_NULL;
static PyObject *__pyx_n_s_ChunkedArray_iterchunks;
static PyObject *__pyx_kp_u_ChunkedArray_was_NULL;
static PyObject *__pyx_n_s_Column;
static PyObject *__pyx_kp_u_Column_does_not_exist_in_table;
static PyObject *__pyx_kp_u_Column_name_0_r_type_1_r;
static PyObject *__pyx_kp_u_Column_r_not_found;
static PyObject *__pyx_kp_u_Comparisons_with_pyarrow_Array_a;
static PyObject *__pyx_n_s_CompressedInputStream;
static PyObject *__pyx_n_s_CompressedOutputStream;
static PyObject *__pyx_kp_u_Convert_pandas_DataFrame_to_an;
static PyObject *__pyx_kp_u_Create_pyarrow_Array_instance_f;
static PyObject *__pyx_n_s_DEFAULT_BUFFER_SIZE;
static PyObject *__pyx_n_s_DataFrame;
static PyObject *__pyx_n_s_DataType;
static PyObject *__pyx_kp_u_DataType_expected_got_r;
static PyObject *__pyx_n_s_Date32Array;
static PyObject *__pyx_n_s_Date32Value;
static PyObject *__pyx_n_s_Date64Array;
static PyObject *__pyx_n_s_Date64Value;
static PyObject *__pyx_n_s_DatetimeTZDtype;
static PyObject *__pyx_n_s_Decimal;
static PyObject *__pyx_n_s_Decimal128Array;
static PyObject *__pyx_n_s_Decimal128Type;
static PyObject *__pyx_n_s_DecimalValue;
static PyObject *__pyx_n_s_DeserializationCallbackError;
static PyObject *__pyx_n_s_DeserializationCallbackError___i;
static PyObject *__pyx_n_s_DictionaryArray;
static PyObject *__pyx_n_s_DictionaryType;
static PyObject *__pyx_n_s_DictionaryValue;
static PyObject *__pyx_kp_u_Do_not_call_Buffer_s_constructor;
static PyObject *__pyx_kp_u_Do_not_call_ChunkedArray_s_const;
static PyObject *__pyx_kp_u_Do_not_call_Column_s_constructor;
static PyObject *__pyx_kp_u_Do_not_call_Field_s_constructor;
static PyObject *__pyx_kp_u_Do_not_call_RecordBatch_s_constr;
static PyObject *__pyx_kp_u_Do_not_call_Schema_s_constructor;
static PyObject *__pyx_kp_u_Do_not_call_Table_s_constructor;
static PyObject *__pyx_kp_u_Do_not_call_Tensor_s_constructor;
static PyObject *__pyx_kp_u_Do_not_call_s_constructor_direct;
static PyObject *__pyx_kp_u_Do_not_call_s_constructor_direct_2;
static PyObject *__pyx_kp_u_Do_not_call_s_constructor_direct_3;
static PyObject *__pyx_kp_u_Do_not_call_s_constructor_direct_4;
static PyObject *__pyx_kp_u_Do_not_call_s_constructor_direct_5;
static PyObject *__pyx_kp_u_Do_not_call_s_constructor_direct_6;
static PyObject *__pyx_kp_u_Do_not_call_s_constructor_direct_7;
static PyObject *__pyx_kp_u_Do_not_call_s_constructor_direct_8;
static PyObject *__pyx_kp_u_Do_not_call_s_constructor_direct_9;
static PyObject *__pyx_n_s_DoubleArray;
static PyObject *__pyx_n_s_DoubleScalar;
static PyObject *__pyx_n_s_DoubleValue;
static PyObject *__pyx_n_s_Empty;
static PyObject *__pyx_kp_u_Expected_integer_or_string_index;
static PyObject *__pyx_n_s_FIXED_OFFSET_RE;
static PyObject *__pyx_kp_u_Failed_to_allocate_0_bytes;
static PyObject *__pyx_n_s_FeatherError;
static PyObject *__pyx_n_s_FeatherReader;
static PyObject *__pyx_n_s_FeatherWriter;
static PyObject *__pyx_n_s_Field;
static PyObject *__pyx_kp_u_File_object_is_malformed_has_no;
static PyObject *__pyx_n_s_FixedOffset;
static PyObject *__pyx_n_s_FixedOffset_2;
static PyObject *__pyx_n_s_FixedSizeBinaryArray;
static PyObject *__pyx_n_s_FixedSizeBinaryType;
static PyObject *__pyx_n_s_FixedSizeBinaryValue;
static PyObject *__pyx_n_s_FixedSizeBufferWriter;
static PyObject *__pyx_n_s_FloatArray;
static PyObject *__pyx_n_s_FloatScalar;
static PyObject *__pyx_n_s_FloatValue;
static PyObject *__pyx_n_s_FloatingPointArray;
static PyObject *__pyx_n_s_Full;
static PyObject *__pyx_n_s_FunctionContext;
static PyObject *__pyx_n_s_FutureWarning;
static PyObject *__pyx_n_b_H;
static PyObject *__pyx_n_s_HDFS_PATH_RE;
static PyObject *__pyx_kp_u_HDFS_client_improperly_initializ;
static PyObject *__pyx_kp_u_HDFS_client_is_closed;
static PyObject *__pyx_n_s_HadoopFileSystem;
static PyObject *__pyx_n_s_HalfFloatArray;
static PyObject *__pyx_n_s_HalfFloatValue;
static PyObject *__pyx_n_s_HdfsFile;
static PyObject *__pyx_n_s_HdfsFileNanny;
static PyObject *__pyx_n_b_I;
static PyObject *__pyx_n_s_IOBase;
static PyObject *__pyx_n_s_IOError;
static PyObject *__pyx_kp_u_I_O_operation_on_closed_file;
static PyObject *__pyx_n_s_ImportError;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x01;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x59;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x9a;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xd4;
static PyObject *__pyx_n_s_Index;
static PyObject *__pyx_n_s_IndexError;
static PyObject *__pyx_kp_u_Index_must_either_be_string_or_i;
static PyObject *__pyx_kp_u_Indices_must_be_integer_type;
static PyObject *__pyx_n_s_Int16Array;
static PyObject *__pyx_n_s_Int16Scalar;
static PyObject *__pyx_n_s_Int16Value;
static PyObject *__pyx_n_s_Int32Array;
static PyObject *__pyx_n_s_Int32Scalar;
static PyObject *__pyx_n_s_Int32Value;
static PyObject *__pyx_n_s_Int64Array;
static PyObject *__pyx_n_s_Int64Scalar;
static PyObject *__pyx_n_s_Int64Value;
static PyObject *__pyx_n_s_Int8Array;
static PyObject *__pyx_n_s_Int8Scalar;
static PyObject *__pyx_n_s_Int8Value;
static PyObject *__pyx_n_s_IntegerArray;
static PyObject *__pyx_kp_u_Invalid_TimeUnit_for_time32;
static PyObject *__pyx_kp_u_Invalid_TimeUnit_for_time64;
static PyObject *__pyx_kp_u_Invalid_TimeUnit_string;
static PyObject *__pyx_kp_u_Invalid_file_mode_0;
static PyObject *__pyx_kp_u_Invalid_union_mode_0_r;
static PyObject *__pyx_kp_u_Invalid_value_for_compression_r;
static PyObject *__pyx_kp_u_Invalid_value_of_whence_0;
static PyObject *__pyx_n_s_K;
static PyObject *__pyx_n_s_KeyError;
static PyObject *__pyx_kp_u_Length_of_names_does_not_match_l;
static PyObject *__pyx_n_s_ListArray;
static PyObject *__pyx_n_s_ListType;
static PyObject *__pyx_n_s_ListValue;
static PyObject *__pyx_n_s_ListValue___iter;
static PyObject *__pyx_kp_u_List_requires_DataType_or_Field;
static PyObject *__pyx_n_s_LoggingMemoryPool;
static PyObject *__pyx_n_s_LooseVersion;
static PyObject *__pyx_n_s_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_kp_u_Metadata_must_be_an_instance_of;
static PyObject *__pyx_n_s_MockOutputStream;
static PyObject *__pyx_kp_u_Mode_must_be_rb_read_wb_write_ne;
static PyObject *__pyx_kp_u_Must_be_an_instance_of_datetime;
static PyObject *__pyx_kp_u_Must_pass_decompressed_size_for;
static PyObject *__pyx_kp_u_Must_pass_names_when_constructin;
static PyObject *__pyx_kp_u_Must_pass_schema_or_at_least_one;
static PyObject *__pyx_n_s_NA;
static PyObject *__pyx_n_s_NAType;
static PyObject *__pyx_n_u_NULL;
static PyObject *__pyx_n_s_NULL_2;
static PyObject *__pyx_kp_u_Names_are_currently_required;
static PyObject *__pyx_n_s_NativeFile;
static PyObject *__pyx_kp_u_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_No_value_specified_for_struct_at_6;
static PyObject *__pyx_kp_u_Non_fixed_width_type;
static PyObject *__pyx_n_u_None;
static PyObject *__pyx_n_s_NotImplemented;
static PyObject *__pyx_n_s_NotImplementedError;
static PyObject *__pyx_n_s_NullArray;
static PyObject *__pyx_n_s_NullType;
static PyObject *__pyx_kp_u_NumPy_array_view_is_only_support;
static PyObject *__pyx_kp_u_NumPy_array_view_is_only_support_2;
static PyObject *__pyx_n_s_NumericArray;
static PyObject *__pyx_n_s_OSFile;
static PyObject *__pyx_kp_u_Offset_must_be_non_negative;
static PyObject *__pyx_kp_u_Offset_must_represent_whole_numb;
static PyObject *__pyx_n_s_OrderedDict;
static PyObject *__pyx_n_s_PY3;
static PyObject *__pyx_n_s_PandasAPIShim;
static PyObject *__pyx_n_s_PandasConvertible;
static PyObject *__pyx_kp_u_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_u_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_RecordBatchStreamReader;
static PyObject *__pyx_n_s_RecordBatchStreamWriter;
static PyObject *__pyx_kp_u_Record_batch_column_index_d_is_o;
static PyObject *__pyx_n_s_ResizableBuffer;
static PyObject *__pyx_kp_u_Returns_implied_schema_from_dat;
static PyObject *__pyx_n_s_Scalar;
static PyObject *__pyx_n_s_ScalarValue;
static PyObject *__pyx_kp_u_Scalar_data_type_was_NULL;
static PyObject *__pyx_kp_u_Scalar_was_NULL;
static PyObject *__pyx_n_s_Schema;
static PyObject *__pyx_n_s_Schema___iter;
static PyObject *__pyx_kp_u_Schema_and_number_of_arrays_uneq;
static PyObject *__pyx_kp_u_Schema_field_name_corresponds_to;
static PyObject *__pyx_kp_u_Schema_from_pandas_line_720;
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_u_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_kp_u_Struct_field_name_corresponds_to;
static PyObject *__pyx_n_s_SystemError;
static PyObject *__pyx_n_s_Table;
static PyObject *__pyx_kp_u_Table_column_index_d_is_out_of_r;
static PyObject *__pyx_kp_u_Table_from_pandas_line_1087;
static PyObject *__pyx_n_s_Table_itercolumns;
static PyObject *__pyx_kp_u_Target_schema_s_field_names_are;
static PyObject *__pyx_n_s_Tensor;
static PyObject *__pyx_kp_u_Tensor_was_NULL;
static PyObject *__pyx_kp_u_The_number_of_names_should_be_eq;
static PyObject *__pyx_kp_u_The_type_id_argument_must_be_a_s;
static PyObject *__pyx_n_s_Thread;
static PyObject *__pyx_n_s_Time32Array;
static PyObject *__pyx_n_s_Time32Type;
static PyObject *__pyx_n_s_Time32Value;
static PyObject *__pyx_n_s_Time64Array;
static PyObject *__pyx_n_s_Time64Type;
static PyObject *__pyx_n_s_Time64Value;
static PyObject *__pyx_n_s_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_u_Type_ID;
static PyObject *__pyx_n_s_Type_INT16;
static PyObject *__pyx_n_s_Type_INT32;
static PyObject *__pyx_n_s_Type_INT64;
static PyObject *__pyx_n_s_Type_INT8;
static PyObject *__pyx_n_s_Type_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_UInt16Scalar;
static PyObject *__pyx_n_s_UInt16Value;
static PyObject *__pyx_n_s_UInt32Array;
static PyObject *__pyx_n_s_UInt32Scalar;
static PyObject *__pyx_n_s_UInt32Value;
static PyObject *__pyx_n_s_UInt64Array;
static PyObject *__pyx_n_s_UInt64Scalar;
static PyObject *__pyx_n_s_UInt64Value;
static PyObject *__pyx_n_s_UInt8Array;
static PyObject *__pyx_n_s_UInt8Scalar;
static PyObject *__pyx_n_s_UInt8Value;
static PyObject *__pyx_kp_u_Unable_to_convert_timezone_to_st;
static PyObject *__pyx_kp_u_Unable_to_read_from_object_of_ty;
static PyObject *__pyx_kp_u_Unable_to_read_message_from_obje;
static PyObject *__pyx_kp_u_Unable_to_wrap_Datum_in_a_Python;
static PyObject *__pyx_n_s_UnionArray;
static PyObject *__pyx_n_s_UnionMode_DENSE;
static PyObject *__pyx_n_s_UnionMode_SPARSE;
static PyObject *__pyx_n_s_UnionType;
static PyObject *__pyx_n_s_UnionType___iter;
static PyObject *__pyx_n_s_UnionValue;
static PyObject *__pyx_kp_u_Unrecognized_compression_type;
static PyObject *__pyx_n_s_UnsupportedOperation;
static PyObject *__pyx_kp_u_Unsupported_type_for_column;
static PyObject *__pyx_n_s_UserWarning;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_kp_u_We_do_not_know_how_to_serialize;
static PyObject *__pyx_kp_u_Writable_buffer_requested_but_Ar;
static PyObject *__pyx_kp_u__136;
static PyObject *__pyx_kp_b__149;
static PyObject *__pyx_kp_u__17;
static PyObject *__pyx_kp_u__18;
static PyObject *__pyx_n_s__2;
static PyObject *__pyx_kp_b__9;
static PyObject *__pyx_n_u_ab;
static PyObject *__pyx_kp_u_accessing_non_existent_buffer_se;
static PyObject *__pyx_n_s_ad;
static PyObject *__pyx_n_s_add;
static PyObject *__pyx_n_s_add_column;
static PyObject *__pyx_n_s_address;
static PyObject *__pyx_n_s_alias;
static PyObject *__pyx_n_s_alignment;
static PyObject *__pyx_n_s_allocate_buffer;
static PyObject *__pyx_n_s_api;
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_n_s_arrow_obj;
static PyObject *__pyx_n_s_as_buffer;
static PyObject *__pyx_n_s_as_py;
static PyObject *__pyx_n_u_as_py;
static PyObject *__pyx_n_s_asarray;
static PyObject *__pyx_n_s_asbytes;
static PyObject *__pyx_n_s_assert_frame_equal;
static PyObject *__pyx_n_s_assert_open;
static PyObject *__pyx_n_s_assert_readable;
static PyObject *__pyx_n_s_assert_seekable;
static PyObject *__pyx_n_s_assert_writable;
static PyObject *__pyx_n_s_astype;
static PyObject *__pyx_n_b_b;
static PyObject *__pyx_n_s_b;
static PyObject *__pyx_n_b_bBhHiIqQ;
static PyObject *__pyx_n_s_base;
static PyObject *__pyx_n_s_bases;
static PyObject *__pyx_n_s_batch;
static PyObject *__pyx_n_s_batches;
static PyObject *__pyx_n_s_benchmark_PandasObjectIsNull;
static PyObject *__pyx_n_s_bg_write;
static PyObject *__pyx_n_s_binary;
static PyObject *__pyx_n_u_binary;
static PyObject *__pyx_n_s_binary_type;
static PyObject *__pyx_n_s_bit_width;
static PyObject *__pyx_n_u_block_size;
static PyObject *__pyx_n_s_body;
static PyObject *__pyx_n_s_body_length;
static PyObject *__pyx_n_s_bool;
static PyObject *__pyx_n_u_bool_2;
static PyObject *__pyx_n_u_boolean;
static PyObject *__pyx_n_s_boxed_field;
static PyObject *__pyx_n_u_brotli;
static PyObject *__pyx_n_s_buf;
static PyObject *__pyx_n_s_buffer;
static PyObject *__pyx_n_s_buffer_size;
static PyObject *__pyx_n_s_buffers;
static PyObject *__pyx_n_s_builtin_pickle;
static PyObject *__pyx_n_s_byte_width;
static PyObject *__pyx_n_u_bz2;
static PyObject *__pyx_kp_u_bz2_2;
static PyObject *__pyx_n_s_c;
static PyObject *__pyx_n_s_c_addr;
static PyObject *__pyx_n_s_c_array;
static PyObject *__pyx_n_s_c_arrays;
static PyObject *__pyx_n_s_c_batches;
static PyObject *__pyx_n_s_c_buf;
static PyObject *__pyx_n_s_c_buffers;
static PyObject *__pyx_n_s_c_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_categorical_type;
static PyObject *__pyx_n_s_categories;
static PyObject *__pyx_n_s_check_metadata;
static PyObject *__pyx_n_s_child;
static PyObject *__pyx_n_s_child_field;
static PyObject *__pyx_n_s_children;
static PyObject *__pyx_n_s_children_fields;
static PyObject *__pyx_n_s_chunk;
static PyObject *__pyx_n_s_chunked_array;
static PyObject *__pyx_n_s_chunks;
static PyObject *__pyx_n_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_closed;
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_common;
static PyObject *__pyx_n_s_compat;
static PyObject *__pyx_n_s_compile;
static PyObject *__pyx_n_s_components;
static PyObject *__pyx_n_s_compress;
static PyObject *__pyx_n_s_compression;
static PyObject *__pyx_n_s_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_n_s_core;
static PyObject *__pyx_kp_u_could_not_infer_open_mode_for_fi;
static PyObject *__pyx_n_s_count;
static PyObject *__pyx_n_s_cpool;
static PyObject *__pyx_n_s_cpp_file;
static PyObject *__pyx_n_s_cpu_count;
static PyObject *__pyx_n_s_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_u_data;
static PyObject *__pyx_n_s_data_frame;
static PyObject *__pyx_n_s_dataframe_to_arrays;
static PyObject *__pyx_n_s_dataframe_to_types;
static PyObject *__pyx_n_s_date;
static PyObject *__pyx_n_s_date32;
static PyObject *__pyx_n_u_date32;
static PyObject *__pyx_kp_u_date32_day;
static PyObject *__pyx_n_s_date64;
static PyObject *__pyx_n_u_date64;
static PyObject *__pyx_kp_u_date64_ms;
static PyObject *__pyx_n_s_date_as_object;
static PyObject *__pyx_n_s_datetime;
static PyObject *__pyx_kp_u_datetime64_ns;
static PyObject *__pyx_n_s_datetime_conversion_functions_l;
static PyObject *__pyx_n_s_decimal;
static PyObject *__pyx_n_s_decimal128;
static PyObject *__pyx_n_s_decode;
static PyObject *__pyx_n_s_decompress;
static PyObject *__pyx_n_s_decompressed_size;
static PyObject *__pyx_n_s_deduplicate_objects;
static PyObject *__pyx_n_s_default_block_size;
static PyObject *__pyx_n_s_default_context_initialized;
static PyObject *__pyx_n_s_default_memory_pool;
static PyObject *__pyx_n_s_default_serialization_context;
static PyObject *__pyx_n_u_dense;
static PyObject *__pyx_n_s_deserialize;
static PyObject *__pyx_n_s_deserialize_components;
static PyObject *__pyx_n_s_deserialize_from;
static PyObject *__pyx_n_s_deserializer;
static PyObject *__pyx_n_s_dest;
static PyObject *__pyx_n_u_detect;
static PyObject *__pyx_n_s_detect_compression;
static PyObject *__pyx_n_s_df;
static PyObject *__pyx_n_s_dict;
static PyObject *__pyx_n_u_dict;
static PyObject *__pyx_n_s_dict_values;
static PyObject *__pyx_n_s_dictionary;
static PyObject *__pyx_n_u_dictionary;
static PyObject *__pyx_n_s_dictionary_2;
static PyObject *__pyx_n_s_dictionary_encode;
static PyObject *__pyx_n_s_dictionary_value;
static PyObject *__pyx_n_u_directory;
static PyObject *__pyx_n_s_distutils_version;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_u_double;
static PyObject *__pyx_n_s_download;
static PyObject *__pyx_n_s_download_locals_bg_write;
static PyObject *__pyx_n_s_download_locals_cleanup;
static PyObject *__pyx_n_s_driver;
static PyObject *__pyx_n_s_dt;
static PyObject *__pyx_n_s_dtype;
static PyObject *__pyx_n_s_dumps;
static PyObject *__pyx_n_b_e;
static PyObject *__pyx_n_s_e;
static PyObject *__pyx_n_s_enable;
static PyObject *__pyx_n_s_encode_file_path;
static PyObject *__pyx_n_s_endswith;
static PyObject *__pyx_n_s_enter;
static PyObject *__pyx_n_s_enumerate;
static PyObject *__pyx_n_s_equals;
static PyObject *__pyx_n_s_example_object;
static PyObject *__pyx_n_s_exc_info;
static PyObject *__pyx_n_s_exc_tb;
static PyObject *__pyx_n_s_exc_type;
static PyObject *__pyx_n_s_exc_val;
static PyObject *__pyx_n_s_exc_value;
static PyObject *__pyx_n_s_exit;
static PyObject *__pyx_n_s_extra_conf;
static PyObject *__pyx_n_b_f;
static PyObject *__pyx_n_s_f;
static PyObject *__pyx_n_u_f2;
static PyObject *__pyx_n_u_f4;
static PyObject *__pyx_n_u_f8;
static PyObject *__pyx_n_s_fastpath;
static PyObject *__pyx_n_s_field;
static PyObject *__pyx_n_s_field_or_name;
static PyObject *__pyx_kp_u_field_or_tuple_expected_got_None;
static PyObject *__pyx_n_s_fields;
static PyObject *__pyx_n_u_fields_2;
static PyObject *__pyx_n_u_file;
static PyObject *__pyx_n_s_file_descriptor;
static PyObject *__pyx_n_s_file_handle;
static PyObject *__pyx_n_s_file_type;
static PyObject *__pyx_n_s_fixed_offset_to_string;
static PyObject *__pyx_n_s_fixed_size_binary_type;
static PyObject *__pyx_n_u_float;
static PyObject *__pyx_n_s_float16;
static PyObject *__pyx_n_u_float16;
static PyObject *__pyx_n_s_float32;
static PyObject *__pyx_n_u_float32;
static PyObject *__pyx_n_s_float64;
static PyObject *__pyx_n_u_float64;
static PyObject *__pyx_n_s_footer_offset;
static PyObject *__pyx_n_s_foreign_buffer;
static PyObject *__pyx_n_s_format;
static PyObject *__pyx_n_s_from_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_u_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_default_context;
static PyObject *__pyx_n_s_get_field_index;
static PyObject *__pyx_n_s_get_record_batch;
static PyObject *__pyx_n_s_get_record_batch_size;
static PyObject *__pyx_n_s_get_space_used;
static PyObject *__pyx_n_s_get_tensor_size;
static PyObject *__pyx_n_s_getnewargs;
static PyObject *__pyx_n_s_getstate;
static PyObject *__pyx_n_s_getvalue;
static PyObject *__pyx_n_s_group;
static PyObject *__pyx_n_u_group;
static PyObject *__pyx_kp_u_gz;
static PyObject *__pyx_n_u_gzip;
static PyObject *__pyx_n_b_h;
static PyObject *__pyx_n_u_halffloat;
static PyObject *__pyx_n_s_handle;
static PyObject *__pyx_n_s_have_libhdfs;
static PyObject *__pyx_n_s_have_libhdfs3;
static PyObject *__pyx_n_s_have_pandas;
static PyObject *__pyx_kp_u_hdfs_d;
static PyObject *__pyx_n_s_hint;
static PyObject *__pyx_n_s_host;
static PyObject *__pyx_n_s_hours;
static PyObject *__pyx_n_b_i;
static PyObject *__pyx_n_s_i;
static PyObject *__pyx_n_u_i1;
static PyObject *__pyx_n_u_i2;
static PyObject *__pyx_n_u_i4;
static PyObject *__pyx_n_u_i8;
static PyObject *__pyx_n_s_id;
static PyObject *__pyx_n_s_ignore_metadata;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_in_stream;
static PyObject *__pyx_n_s_indent;
static PyObject *__pyx_kp_u_index_out_of_bounds;
static PyObject *__pyx_n_s_index_type;
static PyObject *__pyx_n_s_index_value;
static PyObject *__pyx_n_s_indices;
static PyObject *__pyx_n_u_indices;
static PyObject *__pyx_n_s_indices_2;
static PyObject *__pyx_n_s_infer_dtype;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_s_input_stream;
static PyObject *__pyx_n_s_insert;
static PyObject *__pyx_n_s_int16;
static PyObject *__pyx_n_u_int16;
static PyObject *__pyx_n_s_int32;
static PyObject *__pyx_n_u_int32;
static PyObject *__pyx_n_s_int64;
static PyObject *__pyx_n_u_int64;
static PyObject *__pyx_n_s_int8;
static PyObject *__pyx_n_u_int8;
static PyObject *__pyx_n_s_integer_object_nulls;
static PyObject *__pyx_n_s_integer_types;
static PyObject *__pyx_n_s_io;
static PyObject *__pyx_n_s_is_alive;
static PyObject *__pyx_n_s_is_array_like;
static PyObject *__pyx_n_s_is_boolean_value;
static PyObject *__pyx_n_s_is_categorical;
static PyObject *__pyx_n_s_is_data_frame;
static PyObject *__pyx_n_s_is_datetimetz;
static PyObject *__pyx_n_s_is_float_value;
static PyObject *__pyx_n_s_is_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_is_series;
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_u_key_must_either_be_a_slice_or_in;
static PyObject *__pyx_n_s_keys;
static PyObject *__pyx_n_u_kind;
static PyObject *__pyx_n_u_last_access_time;
static PyObject *__pyx_n_u_last_accessed;
static PyObject *__pyx_n_u_last_modified;
static PyObject *__pyx_n_u_last_modified_time;
static PyObject *__pyx_n_s_length;
static PyObject *__pyx_n_s_lib;
static PyObject *__pyx_n_u_libhdfs;
static PyObject *__pyx_n_u_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_logging_memory_pool;
static PyObject *__pyx_n_s_lower;
static PyObject *__pyx_n_u_lz4;
static PyObject *__pyx_kp_u_lz4_2;
static PyObject *__pyx_n_s_m;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_make_datetimetz;
static PyObject *__pyx_n_s_make_series;
static PyObject *__pyx_n_s_map;
static PyObject *__pyx_n_s_mask;
static PyObject *__pyx_kp_u_mask_not_implemented_with_Arrow;
static PyObject *__pyx_n_s_match;
static PyObject *__pyx_n_s_max_output_size;
static PyObject *__pyx_n_s_memory_map;
static PyObject *__pyx_n_s_memory_pool;
static PyObject *__pyx_n_s_memoryview;
static PyObject *__pyx_n_s_message;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_metadata;
static PyObject *__pyx_kp_u_metadata_2;
static PyObject *__pyx_n_s_metadata_length;
static PyObject *__pyx_n_s_microseconds;
static PyObject *__pyx_n_s_milliseconds;
static PyObject *__pyx_n_s_minutes;
static PyObject *__pyx_n_s_mmap;
static PyObject *__pyx_n_s_mode;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_mro;
static PyObject *__pyx_n_u_ms;
static PyObject *__pyx_n_s_multiprocessing;
static PyObject *__pyx_n_s_n;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_name_2;
static PyObject *__pyx_n_u_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_ndarray_to_arrow_type;
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_u_not_registered_in_deserializati;
static PyObject *__pyx_kp_u_not_supported_for_buffer_protoc;
static PyObject *__pyx_n_s_np;
static PyObject *__pyx_n_u_ns;
static PyObject *__pyx_n_s_nthreads;
static PyObject *__pyx_n_s_null;
static PyObject *__pyx_n_u_null;
static PyObject *__pyx_n_s_null_bitmap;
static PyObject *__pyx_n_s_null_count;
static PyObject *__pyx_n_s_nullable;
static PyObject *__pyx_n_s_num_arrays;
static PyObject *__pyx_n_s_num_buffers;
static PyObject *__pyx_n_u_num_buffers;
static PyObject *__pyx_n_s_num_chunks;
static PyObject *__pyx_n_s_num_columns;
static PyObject *__pyx_n_s_num_ndarrays;
static PyObject *__pyx_n_u_num_ndarrays;
static PyObject *__pyx_n_s_num_record_batches;
static PyObject *__pyx_n_s_num_rows;
static PyObject *__pyx_n_s_num_tensors;
static PyObject *__pyx_n_u_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_u_only_slices_with_step_1_supporte;
static PyObject *__pyx_kp_u_only_valid_on_readonly_files;
static PyObject *__pyx_kp_u_only_valid_on_seekable_files;
static PyObject *__pyx_kp_u_only_valid_on_writable_files;
static PyObject *__pyx_n_s_open;
static PyObject *__pyx_n_s_open_2;
static PyObject *__pyx_n_s_open_stream;
static PyObject *__pyx_n_s_options;
static PyObject *__pyx_n_s_ordered;
static PyObject *__pyx_n_u_ordered;
static PyObject *__pyx_n_s_os;
static PyObject *__pyx_n_s_other;
static PyObject *__pyx_n_s_out;
static PyObject *__pyx_n_s_out_buf;
static PyObject *__pyx_n_s_output_buffer;
static PyObject *__pyx_n_s_output_length;
static PyObject *__pyx_n_s_output_size;
static PyObject *__pyx_n_s_output_stream;
static PyObject *__pyx_n_s_owner;
static PyObject *__pyx_n_u_owner;
static PyObject *__pyx_n_u_pa_getnewargs;
static PyObject *__pyx_kp_u_pa_input_stream_called_with_inst;
static PyObject *__pyx_kp_u_pa_output_stream_called_with_ins;
static PyObject *__pyx_n_b_pandas;
static PyObject *__pyx_n_s_pandas;
static PyObject *__pyx_n_s_pandas_api;
static PyObject *__pyx_n_s_pandas_api_types;
static PyObject *__pyx_n_s_pandas_types_dtypes;
static PyObject *__pyx_n_s_parent;
static PyObject *__pyx_n_s_path;
static PyObject *__pyx_n_u_path;
static PyObject *__pyx_n_u_permissions;
static PyObject *__pyx_n_s_pformat;
static PyObject *__pyx_n_s_pickle;
static PyObject *__pyx_n_u_pickle;
static PyObject *__pyx_kp_u_please_pass_it_explicitly;
static PyObject *__pyx_n_s_pool;
static PyObject *__pyx_n_s_pop;
static PyObject *__pyx_n_s_port;
static PyObject *__pyx_n_s_pos;
static PyObject *__pyx_n_s_position;
static PyObject *__pyx_n_s_pprint;
static PyObject *__pyx_n_s_precision;
static PyObject *__pyx_kp_u_precision_should_be_between_1_an;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_preserve_index;
static PyObject *__pyx_kp_u_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_u_pyarrow;
static PyObject *__pyx_kp_u_pyarrow_Field_0;
static PyObject *__pyx_kp_u_pyarrow_Message_type_0_metadata;
static PyObject *__pyx_kp_u_pyarrow_Tensor_type_0_type_shap;
static PyObject *__pyx_kp_s_pyarrow_array_pxi;
static PyObject *__pyx_kp_s_pyarrow_benchmark_pxi;
static PyObject *__pyx_n_s_pyarrow_compat;
static PyObject *__pyx_kp_u_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_n_s_pyarrow_serialization;
static PyObject *__pyx_kp_s_pyarrow_serialization_pxi;
static PyObject *__pyx_kp_s_pyarrow_table_pxi;
static PyObject *__pyx_kp_s_pyarrow_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_u_pytype;
static PyObject *__pyx_n_s_pytz;
static PyObject *__pyx_n_s_pyx_PickleError;
static PyObject *__pyx_n_s_pyx_checksum;
static PyObject *__pyx_n_s_pyx_result;
static PyObject *__pyx_n_s_pyx_state;
static PyObject *__pyx_n_s_pyx_type;
static PyObject *__pyx_n_s_pyx_unpickle_Scalar;
static PyObject *__pyx_n_s_pyx_unpickle_SerializationCont;
static PyObject *__pyx_n_s_pyx_unpickle__PandasAPIShim;
static PyObject *__pyx_n_s_pyx_unpickle__PandasConvertibl;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_b_q;
static PyObject *__pyx_n_s_qsize;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_queue;
static PyObject *__pyx_n_u_r;
static PyObject *__pyx_kp_u_r_2;
static PyObject *__pyx_kp_u_r_b;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_kp_u_rb;
static PyObject *__pyx_n_u_rb_2;
static PyObject *__pyx_n_s_rd_file;
static PyObject *__pyx_n_s_re;
static PyObject *__pyx_n_s_read;
static PyObject *__pyx_n_u_read;
static PyObject *__pyx_n_s_read_message;
static PyObject *__pyx_n_s_read_next_batch;
static PyObject *__pyx_n_s_read_next_message;
static PyObject *__pyx_n_s_read_record_batch;
static PyObject *__pyx_n_s_read_schema;
static PyObject *__pyx_n_s_read_serialized;
static PyObject *__pyx_n_s_read_tensor;
static PyObject *__pyx_n_s_readable;
static PyObject *__pyx_kp_u_readable_file_expected;
static PyObject *__pyx_n_s_reader;
static PyObject *__pyx_n_s_readline;
static PyObject *__pyx_n_s_readlines;
static PyObject *__pyx_n_s_reconstruct_record_batch;
static PyObject *__pyx_n_s_reconstruct_table;
static PyObject *__pyx_n_s_recursive;
static PyObject *__pyx_n_s_reduce;
static PyObject *__pyx_n_s_reduce_cython;
static PyObject *__pyx_n_s_reduce_ex;
static PyObject *__pyx_n_s_ref;
static PyObject *__pyx_n_s_register;
static PyObject *__pyx_n_s_register_default_serialization_h;
static PyObject *__pyx_n_s_remove_column;
static PyObject *__pyx_n_s_replace;
static PyObject *__pyx_n_s_replication;
static PyObject *__pyx_n_u_replication;
static PyObject *__pyx_n_s_repr;
static PyObject *__pyx_n_s_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_u_s;
static PyObject *__pyx_n_s_safe;
static PyObject *__pyx_n_s_scale;
static PyObject *__pyx_n_s_schema;
static PyObject *__pyx_n_s_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_logging_pool_self_pool_cann;
static PyObject *__pyx_kp_s_self_pool_cannot_be_converted_to;
static PyObject *__pyx_kp_s_self_pool_self_proxy_pool_cannot;
static PyObject *__pyx_kp_s_self_reader_cannot_be_converted;
static PyObject *__pyx_kp_s_self_sp_array_cannot_be_converte;
static PyObject *__pyx_kp_s_self_sp_scalar_cannot_be_convert;
static PyObject *__pyx_kp_s_self_sp_tensor_self_tp_cannot_be;
static PyObject *__pyx_kp_s_self_writer_cannot_be_converted;
static PyObject *__pyx_n_s_send;
static PyObject *__pyx_n_s_serialize;
static PyObject *__pyx_n_s_serialize_to;
static PyObject *__pyx_n_s_serialized;
static PyObject *__pyx_n_s_serializer;
static PyObject *__pyx_n_s_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_u_size;
static PyObject *__pyx_n_s_skipna;
static PyObject *__pyx_n_s_sleep;
static PyObject *__pyx_n_s_slice;
static PyObject *__pyx_n_u_snappy;
static PyObject *__pyx_n_s_source;
static PyObject *__pyx_n_s_source_path;
static PyObject *__pyx_n_s_sp_chunked_array;
static PyObject *__pyx_n_s_sp_column;
static PyObject *__pyx_n_s_sp_data_type;
static PyObject *__pyx_n_s_sp_tensor;
static PyObject *__pyx_n_u_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_u_str_2;
static PyObject *__pyx_n_s_stream;
static PyObject *__pyx_n_s_stream_or_path;
static PyObject *__pyx_n_s_string;
static PyObject *__pyx_n_u_string;
static PyObject *__pyx_n_s_string_to_tzinfo;
static PyObject *__pyx_n_s_string_types;
static PyObject *__pyx_n_s_stringify_path;
static PyObject *__pyx_n_s_strings_to_categorical;
static PyObject *__pyx_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_testing;
static PyObject *__pyx_n_s_threading;
static PyObject *__pyx_n_s_throw;
static PyObject *__pyx_n_s_time;
static PyObject *__pyx_n_s_time32;
static PyObject *__pyx_kp_u_time32_ms;
static PyObject *__pyx_kp_u_time32_s;
static PyObject *__pyx_n_s_time64;
static PyObject *__pyx_kp_u_time64_ns;
static PyObject *__pyx_kp_u_time64_us;
static PyObject *__pyx_n_s_timedelta;
static PyObject *__pyx_n_s_timeout;
static PyObject *__pyx_n_s_timestamp;
static PyObject *__pyx_kp_u_timestamp_ms;
static PyObject *__pyx_kp_u_timestamp_ns;
static PyObject *__pyx_kp_u_timestamp_s;
static PyObject *__pyx_kp_u_timestamp_us;
static PyObject *__pyx_n_s_timezone;
static PyObject *__pyx_n_s_to_pandas;
static PyObject *__pyx_n_s_to_pandas_2;
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_total_seconds;
static PyObject *__pyx_n_s_truncate;
static PyObject *__pyx_kp_u_trying_to_write_an_immutable_buf;
static PyObject *__pyx_n_s_type;
static PyObject *__pyx_kp_u_type_2;
static PyObject *__pyx_n_s_type_3;
static PyObject *__pyx_n_s_type_4;
static PyObject *__pyx_n_s_type_codes;
static PyObject *__pyx_n_s_type_for_alias;
static PyObject *__pyx_n_s_type_id;
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_tzinfo_to_string_locals_fixed_of;
static PyObject *__pyx_n_u_u1;
static PyObject *__pyx_n_u_u2;
static PyObject *__pyx_n_u_u4;
static PyObject *__pyx_n_u_u8;
static PyObject *__pyx_n_s_uint16;
static PyObject *__pyx_n_u_uint16;
static PyObject *__pyx_n_s_uint32;
static PyObject *__pyx_n_u_uint32;
static PyObject *__pyx_n_s_uint64;
static PyObject *__pyx_n_u_uint64;
static PyObject *__pyx_n_s_uint8;
static PyObject *__pyx_n_u_uint8;
static PyObject *__pyx_n_u_uncompressed;
static PyObject *__pyx_n_s_union;
static PyObject *__pyx_n_s_union_type;
static PyObject *__pyx_n_s_unique;
static PyObject *__pyx_n_s_unit;
static PyObject *__pyx_n_s_unit_code;
static PyObject *__pyx_kp_u_unknown_driver_r;
static PyObject *__pyx_n_s_update;
static PyObject *__pyx_n_s_upload;
static PyObject *__pyx_n_s_upload_locals_bg_write;
static PyObject *__pyx_n_u_us;
static PyObject *__pyx_n_s_use_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_u_utc;
static PyObject *__pyx_n_s_utcfromtimestamp;
static PyObject *__pyx_n_s_utcoffset;
static PyObject *__pyx_n_s_utf8;
static PyObject *__pyx_n_u_utf8;
static PyObject *__pyx_n_s_util;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_s_value_offsets;
static PyObject *__pyx_n_s_value_type;
static PyObject *__pyx_n_s_values;
static PyObject *__pyx_n_s_values_2;
static PyObject *__pyx_n_s_version;
static PyObject *__pyx_n_u_w;
static PyObject *__pyx_n_s_warn;
static PyObject *__pyx_n_s_warnings;
static PyObject *__pyx_n_u_wb;
static PyObject *__pyx_n_s_weakref;
static PyObject *__pyx_n_s_whence;
static PyObject *__pyx_n_s_window;
static PyObject *__pyx_n_s_wrapped_value;
static PyObject *__pyx_n_s_writable;
static PyObject *__pyx_kp_u_writable_file_expected;
static PyObject *__pyx_n_s_write;
static PyObject *__pyx_n_u_write;
static PyObject *__pyx_n_s_write_batch;
static PyObject *__pyx_n_s_write_table;
static PyObject *__pyx_n_s_write_tensor;
static PyObject *__pyx_n_s_write_to;
static PyObject *__pyx_n_s_x;
static PyObject *__pyx_n_s_zero_copy_only;
static PyObject *__pyx_n_s_zip;
static PyObject *__pyx_n_s_zone;
static PyObject *__pyx_kp_u_zst;
static PyObject *__pyx_n_u_zstd;
static PyObject *__pyx_pf_7pyarrow_3lib_cpu_count(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_2set_cpu_count(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_count); /* proto */
static int __pyx_pf_7pyarrow_3lib_14_PandasAPIShim___init__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_2make_series(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_4data_frame(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_11have_pandas___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_6compat___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_2pd___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_6infer_dtype(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_13loose_version___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_7version___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_16categorical_type___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_15datetimetz_type___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_8is_array_like(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_10is_categorical(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_12is_datetimetz(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_14is_data_frame(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_16is_series(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_18assert_frame_equal(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_14_loose_version___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_8_version___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_3_pd___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_10_types_api___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_14_compat_module___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_11_data_frame___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_6_index___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_7_series___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_17_categorical_type___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_16_datetimetz_type___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_17_array_like_types___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_20__reduce_cython__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_22__setstate_cython__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_10MemoryPool___init__(struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10MemoryPool_2bytes_allocated(struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10MemoryPool_4max_memory(struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10MemoryPool_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10MemoryPool_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_17LoggingMemoryPool___init__(struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_17LoggingMemoryPool_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_17LoggingMemoryPool_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_15ProxyMemoryPool___init__(struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15ProxyMemoryPool_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15ProxyMemoryPool_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_4default_memory_pool(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6proxy_memory_pool(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_parent); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8logging_memory_pool(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_parent); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10set_memory_pool(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12log_memory_allocations(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_enable); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14total_allocated_bytes(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16_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 PyObject *__pyx_pf_7pyarrow_3lib_9UnionType_10type_codes___get__(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_pf_7pyarrow_3lib_9UnionType___len__(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9UnionType_2__iter__(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9UnionType_5__getitem__(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9UnionType_7__reduce__(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13TimestampType_4unit___get__(struct __pyx_obj_7pyarrow_3lib_TimestampType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13TimestampType_2tz___get__(struct __pyx_obj_7pyarrow_3lib_TimestampType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13TimestampType_to_pandas_dtype(struct __pyx_obj_7pyarrow_3lib_TimestampType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13TimestampType_2__reduce__(struct __pyx_obj_7pyarrow_3lib_TimestampType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10Time32Type_4unit___get__(struct __pyx_obj_7pyarrow_3lib_Time32Type *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10Time64Type_4unit___get__(struct __pyx_obj_7pyarrow_3lib_Time64Type *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_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 Py_hash_t __pyx_pf_7pyarrow_3lib_6Schema_13__hash__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_15pandas_metadata___get__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_5names___get__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_5types___get__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_8metadata___get__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_15__eq__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_17empty_table(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_19equals(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_21from_pandas(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_df, int __pyx_v_preserve_index); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_23field_by_name(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_25get_field_index(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_27append(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_29insert(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_31remove(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, int __pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_33set(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_35add_metadata(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_37serialize(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_39remove_metadata(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_41__str__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_43__repr__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18field(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_20null(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_22bool_(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_24uint8(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_26int8(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_28uint16(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_30int16(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_32uint32(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_34int32(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_36uint64(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_38int64(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16tzinfo_to_string_fixed_offset_to_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_offset); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_40tzinfo_to_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tz); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_42string_to_tzinfo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_44timestamp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_unit, PyObject *__pyx_v_tz); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_46time32(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_unit); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_48time64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_unit); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_50date32(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_52date64(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_54float16(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_56float32(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_58float64(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_60decimal128(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_precision, int __pyx_v_scale); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_62string(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_64utf8(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_66binary(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_length); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_68list_(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value_type); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_70dictionary(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_72struct(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fields); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_74union(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_children_fields, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_76type_for_alias(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_78schema(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fields, PyObject *__pyx_v_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_80from_numpy_dtype(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dtype); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_82is_boolean_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_84is_integer_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_86is_float_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Scalar_4type___get__(struct __pyx_obj_7pyarrow_3lib_Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Scalar___reduce_cython__(struct __pyx_obj_7pyarrow_3lib_Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Scalar_2__setstate_cython__(struct __pyx_obj_7pyarrow_3lib_Scalar *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_8NullType___cinit__(struct __pyx_obj_7pyarrow_3lib_NullType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8NullType_2__repr__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NullType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8NullType_4as_py(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NullType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8NullType_6__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_lambda_funcdef_lambda(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_tzinfo); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_tzinfo); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_tzinfo); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda3(PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_tzinfo); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda4(PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_tzinfo); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda5(PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_tzinfo); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda6(PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_tzinfo); /* 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_2as_buffer(struct __pyx_obj_7pyarrow_3lib_BinaryValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11BinaryValue_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BinaryValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11BinaryValue_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BinaryValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static 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 int __pyx_pf_7pyarrow_3lib_11ScalarValue___init__(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11ScalarValue_2__repr__(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11ScalarValue_4__str__(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11ScalarValue_6__eq__(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static Py_hash_t __pyx_pf_7pyarrow_3lib_11ScalarValue_8__hash__(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11ScalarValue_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11ScalarValue_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11UInt8Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_UInt8Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11UInt8Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt8Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11UInt8Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt8Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10Int8Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_Int8Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10Int8Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int8Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10Int8Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int8Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12UInt16Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_UInt16Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12UInt16Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt16Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12UInt16Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt16Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Int16Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_Int16Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Int16Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int16Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Int16Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int16Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12UInt32Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_UInt32Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12UInt32Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt32Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12UInt32Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt32Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Int32Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_Int32Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Int32Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int32Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Int32Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int32Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12UInt64Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_UInt64Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12UInt64Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt64Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12UInt64Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt64Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Int64Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_Int64Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Int64Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int64Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Int64Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int64Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11FloatScalar_as_py(struct __pyx_obj_7pyarrow_3lib_FloatScalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11FloatScalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FloatScalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11FloatScalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FloatScalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12DoubleScalar_as_py(struct __pyx_obj_7pyarrow_3lib_DoubleScalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12DoubleScalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DoubleScalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12DoubleScalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DoubleScalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_88_ndarray_to_arrow_type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_values, struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_90array(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_92asarray(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_values, PyObject *__pyx_v_type); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_94_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_96_restore_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18_PandasConvertible_to_pandas(struct __pyx_obj_7pyarrow_3lib__PandasConvertible *__pyx_v_self, PyObject *__pyx_v_categories, int __pyx_v_strings_to_categorical, int __pyx_v_zero_copy_only, int __pyx_v_integer_object_nulls, int __pyx_v_date_as_object, int __pyx_v_use_threads, int __pyx_v_deduplicate_objects, int __pyx_v_ignore_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18_PandasConvertible_2__reduce_cython__(struct __pyx_obj_7pyarrow_3lib__PandasConvertible *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18_PandasConvertible_4__setstate_cython__(struct __pyx_obj_7pyarrow_3lib__PandasConvertible *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_5Array___init__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_2__eq__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_4_debug_print(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_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_8sum(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_10unique(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_12dictionary_encode(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_14from_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_16__reduce__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_18from_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_20__iter__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_23__repr__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_25format(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_27__str__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_29equals(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_31__len__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_33isnull(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_35__getitem__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_37slice(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_39_to_pandas(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_options, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_41__array__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_dtype); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_43to_numpy(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_45to_pylist(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_47validate(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_49buffers(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_9ListArray_2flatten(struct __pyx_obj_7pyarrow_3lib_ListArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10UnionArray_from_dense(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_types, struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_value_offsets, PyObject *__pyx_v_children); /* 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_21__eq__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_23equals(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_25_to_pandas(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_options, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_27__array__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_dtype); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_29dictionary_encode(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_31unique(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_33slice(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_35chunk(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_37iterchunks(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_40to_pylist(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_98chunked_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arrays, PyObject *__pyx_v_type); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_100column(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__getitem__(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Column_10from_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Column_12cast(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_14dictionary_encode(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Column_16unique(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Column_18flatten(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_20_to_pandas(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self, PyObject *__pyx_v_options, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Column_22__array__(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self, PyObject *__pyx_v_dtype); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Column_24__eq__(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self, PyObject *__pyx_v_other); /* 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_22_to_pandas(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, PyObject *__pyx_v_options, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_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_102_reconstruct_record_batch(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_columns, PyObject *__pyx_v_schema); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_104table_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_14__eq__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_16equals(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_18cast(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_20from_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_22from_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_24from_batches(PyObject *__pyx_v_batches, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_26to_batches(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_chunksize); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_28_to_pandas(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_options, PyObject *__pyx_v_categories, PyObject *__pyx_v_ignore_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_30to_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_32column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_34_column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, int __pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_36__getitem__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_38itercolumns(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_41__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_43add_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_45append_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_47remove_column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, int __pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_49set_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_51drop(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_columns); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_106_reconstruct_table(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arrays, PyObject *__pyx_v_schema); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_108concat_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_6closed___get__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_18close(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_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_28_assert_seekable(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_30size(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_32tell(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_34seek(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_36write(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_38read(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_nbytes); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_40read1(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_nbytes); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_42readall(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_44readinto(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_b); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_46readline(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_48readlines(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_50__iter__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_52__next__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_54read_buffer(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_nbytes); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_56truncate(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_58writelines(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_60download(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_62upload(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_64__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_66__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_110memory_map(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_112create_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_114allocate_buffer(CYTHON_UNUSED PyObject *__pyx_self, int64_t __pyx_v_size, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool, PyObject *__pyx_v_resizable); /* proto */
static int __pyx_pf_7pyarrow_3lib_18BufferOutputStream___cinit__(struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18BufferOutputStream_2getvalue(struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18BufferOutputStream_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18BufferOutputStream_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_16MockOutputStream___cinit__(struct __pyx_obj_7pyarrow_3lib_MockOutputStream *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16MockOutputStream_2size(struct __pyx_obj_7pyarrow_3lib_MockOutputStream *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16MockOutputStream_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MockOutputStream *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16MockOutputStream_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MockOutputStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_12BufferReader___cinit__(struct __pyx_obj_7pyarrow_3lib_BufferReader *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12BufferReader_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12BufferReader_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_21CompressedInputStream___init__(struct __pyx_obj_7pyarrow_3lib_CompressedInputStream *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream, PyObject *__pyx_v_compression); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_21CompressedInputStream_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_CompressedInputStream *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_21CompressedInputStream_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_CompressedInputStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_22CompressedOutputStream___init__(struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream, PyObject *__pyx_v_compression); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_22CompressedOutputStream_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_22CompressedOutputStream_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_19BufferedInputStream___init__(struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream, int __pyx_v_buffer_size, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19BufferedInputStream_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19BufferedInputStream_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_20BufferedOutputStream___init__(struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream, int __pyx_v_buffer_size, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20BufferedOutputStream_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20BufferedOutputStream_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_116py_buffer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_118foreign_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_120as_buffer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_o); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_122_detect_compression(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_124compress(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_126decompress(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_128input_stream(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_compression, PyObject *__pyx_v_buffer_size); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_130output_stream(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_compression, PyObject *__pyx_v_buffer_size); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_132have_libhdfs(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_134have_libhdfs3(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_136strip_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 PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_write(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self, PyObject *__pyx_v_table_or_batch); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_2write_batch(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_batch); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_4write_table(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_table, PyObject *__pyx_v_chunksize); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_6close(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_8__enter__(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_10__exit__(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_val, CYTHON_UNUSED PyObject *__pyx_v_exc_tb); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *__pyx_v_self); /* proto */
static void __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_2__dealloc__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_4_open(struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *__pyx_v_self, PyObject *__pyx_v_sink, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader___iter__(struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_3get_next_batch(struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_5read_next_batch(struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_7read_all(struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_9__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_11__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_2_open(struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *__pyx_v_self, PyObject *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_6schema___get__(struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileWriter__open(struct __pyx_obj_7pyarrow_3lib__RecordBatchFileWriter *__pyx_v_self, PyObject *__pyx_v_sink, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema); /* 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_138get_tensor_size(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_tensor); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_140get_record_batch_size(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_batch); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_142write_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_144read_tensor(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_146read_message(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_148read_schema(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_150read_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_read(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_10_read_indices(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self, PyObject *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_12_read_names(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self, PyObject *__pyx_v_names); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_14__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_16__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14is_named_tuple_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_152is_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_154_get_default_context(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_11total_bytes___get__(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_write_to(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self, PyObject *__pyx_v_sink); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_2deserialize(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_4to_buffer(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self, PyObject *__pyx_v_nthreads); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_6from_components(PyObject *__pyx_v_components); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_8to_components(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self, PyObject *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_4base___get__(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_156serialize(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_158serialize_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_160read_serialized(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_base); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_162deserialize_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_164deserialize_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_166deserialize(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_168benchmark_PandasObjectIsNull(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_170__pyx_unpickle__PandasAPIShim(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_172__pyx_unpickle_Scalar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_174__pyx_unpickle__PandasConvertible(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_176__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_StructType(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_ScalarValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Int8Value(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Int64Value(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_ListValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_StructValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UnionValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_StringValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_FixedSizeBinaryValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib__PandasConvertible(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Tensor(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_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__CRecordBatchWriter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib__CRecordBatchReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib__PandasAPIShim(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_LoggingMemoryPool(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_ProxyMemoryPool(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UnionType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_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_UInt8Scalar(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Int8Scalar(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt16Scalar(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Int16Scalar(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt32Scalar(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Int32Scalar(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt64Scalar(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Int64Scalar(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_FloatScalar(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_DoubleScalar(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib__FunctionContext(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Date32Array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Date64Array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_TimestampArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Time32Array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Time64Array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_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_CompressedInputStream(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_CompressedOutputStream(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_BufferedInputStream(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_BufferedOutputStream(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_HadoopFileSystem(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib__HdfsFileNanny(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_HdfsFile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_MessageReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib__RecordBatchStreamWriter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib__RecordBatchStreamReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib__RecordBatchFileWriter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib__RecordBatchFileReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_FeatherWriter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_FeatherReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_SerializationContext(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_SerializedPyObject(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct____iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_1___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_2___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions(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___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_7_iterchunks(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_8_itercolumns(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_9_download(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_10_upload(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___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_13_is_named_tuple(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_14_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_update = {0, &__pyx_n_s_update, 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_1686295;
static PyObject *__pyx_int_93969614;
static PyObject *__pyx_int_162458991;
static PyObject *__pyx_int_222419149;
static PyObject *__pyx_int_1000000000;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_tuple_;
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__8;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__19;
static PyObject *__pyx_tuple__20;
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__75;
static PyObject *__pyx_tuple__76;
static PyObject *__pyx_tuple__77;
static PyObject *__pyx_tuple__78;
static PyObject *__pyx_tuple__79;
static PyObject *__pyx_tuple__80;
static PyObject *__pyx_tuple__81;
static PyObject *__pyx_tuple__82;
static PyObject *__pyx_tuple__83;
static PyObject *__pyx_tuple__84;
static PyObject *__pyx_tuple__85;
static PyObject *__pyx_tuple__86;
static PyObject *__pyx_tuple__87;
static PyObject *__pyx_tuple__88;
static PyObject *__pyx_tuple__89;
static PyObject *__pyx_tuple__90;
static PyObject *__pyx_tuple__91;
static PyObject *__pyx_tuple__92;
static PyObject *__pyx_tuple__93;
static PyObject *__pyx_tuple__94;
static PyObject *__pyx_tuple__95;
static PyObject *__pyx_tuple__96;
static PyObject *__pyx_tuple__97;
static PyObject *__pyx_tuple__98;
static PyObject *__pyx_tuple__99;
static PyObject *__pyx_tuple__100;
static PyObject *__pyx_tuple__101;
static PyObject *__pyx_tuple__102;
static PyObject *__pyx_tuple__103;
static PyObject *__pyx_tuple__104;
static PyObject *__pyx_tuple__105;
static PyObject *__pyx_tuple__106;
static PyObject *__pyx_tuple__107;
static PyObject *__pyx_tuple__108;
static PyObject *__pyx_tuple__109;
static PyObject *__pyx_tuple__110;
static PyObject *__pyx_tuple__111;
static PyObject *__pyx_tuple__112;
static PyObject *__pyx_tuple__113;
static PyObject *__pyx_tuple__114;
static PyObject *__pyx_tuple__115;
static PyObject *__pyx_tuple__116;
static PyObject *__pyx_tuple__117;
static PyObject *__pyx_tuple__118;
static PyObject *__pyx_tuple__119;
static PyObject *__pyx_tuple__120;
static PyObject *__pyx_tuple__121;
static PyObject *__pyx_tuple__122;
static PyObject *__pyx_tuple__123;
static PyObject *__pyx_tuple__124;
static PyObject *__pyx_tuple__125;
static PyObject *__pyx_tuple__126;
static PyObject *__pyx_tuple__127;
static PyObject *__pyx_tuple__128;
static PyObject *__pyx_tuple__129;
static PyObject *__pyx_tuple__130;
static PyObject *__pyx_tuple__131;
static PyObject *__pyx_tuple__132;
static PyObject *__pyx_tuple__133;
static PyObject *__pyx_tuple__134;
static PyObject *__pyx_tuple__135;
static PyObject *__pyx_tuple__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__152;
static PyObject *__pyx_tuple__154;
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__184;
static PyObject *__pyx_tuple__185;
static PyObject *__pyx_tuple__186;
static PyObject *__pyx_tuple__187;
static PyObject *__pyx_tuple__188;
static PyObject *__pyx_tuple__189;
static PyObject *__pyx_tuple__190;
static PyObject *__pyx_tuple__191;
static PyObject *__pyx_tuple__192;
static PyObject *__pyx_tuple__193;
static PyObject *__pyx_tuple__194;
static PyObject *__pyx_tuple__195;
static PyObject *__pyx_tuple__196;
static PyObject *__pyx_tuple__197;
static PyObject *__pyx_tuple__198;
static PyObject *__pyx_tuple__199;
static PyObject *__pyx_tuple__200;
static PyObject *__pyx_tuple__201;
static PyObject *__pyx_tuple__202;
static PyObject *__pyx_tuple__203;
static PyObject *__pyx_tuple__204;
static PyObject *__pyx_tuple__205;
static PyObject *__pyx_tuple__206;
static PyObject *__pyx_tuple__207;
static PyObject *__pyx_tuple__208;
static PyObject *__pyx_tuple__209;
static PyObject *__pyx_tuple__210;
static PyObject *__pyx_tuple__211;
static PyObject *__pyx_tuple__212;
static PyObject *__pyx_tuple__213;
static PyObject *__pyx_tuple__214;
static PyObject *__pyx_tuple__215;
static PyObject *__pyx_tuple__216;
static PyObject *__pyx_tuple__217;
static PyObject *__pyx_tuple__218;
static PyObject *__pyx_tuple__219;
static PyObject *__pyx_tuple__220;
static PyObject *__pyx_tuple__221;
static PyObject *__pyx_tuple__222;
static PyObject *__pyx_tuple__223;
static PyObject *__pyx_tuple__224;
static PyObject *__pyx_tuple__225;
static PyObject *__pyx_tuple__226;
static PyObject *__pyx_tuple__227;
static PyObject *__pyx_tuple__228;
static PyObject *__pyx_tuple__229;
static PyObject *__pyx_tuple__230;
static PyObject *__pyx_tuple__231;
static PyObject *__pyx_tuple__232;
static PyObject *__pyx_tuple__233;
static PyObject *__pyx_tuple__235;
static PyObject *__pyx_tuple__237;
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__250;
static PyObject *__pyx_tuple__252;
static PyObject *__pyx_tuple__264;
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__282;
static PyObject *__pyx_tuple__284;
static PyObject *__pyx_tuple__286;
static PyObject *__pyx_tuple__288;
static PyObject *__pyx_tuple__289;
static PyObject *__pyx_tuple__290;
static PyObject *__pyx_tuple__291;
static PyObject *__pyx_tuple__292;
static PyObject *__pyx_tuple__294;
static PyObject *__pyx_tuple__296;
static PyObject *__pyx_tuple__298;
static PyObject *__pyx_tuple__300;
static PyObject *__pyx_tuple__302;
static PyObject *__pyx_tuple__304;
static PyObject *__pyx_tuple__306;
static PyObject *__pyx_tuple__308;
static PyObject *__pyx_tuple__310;
static PyObject *__pyx_tuple__312;
static PyObject *__pyx_tuple__314;
static PyObject *__pyx_tuple__316;
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_tuple__360;
static PyObject *__pyx_tuple__362;
static PyObject *__pyx_tuple__364;
static PyObject *__pyx_tuple__366;
static PyObject *__pyx_tuple__368;
static PyObject *__pyx_tuple__370;
static PyObject *__pyx_tuple__372;
static PyObject *__pyx_tuple__374;
static PyObject *__pyx_tuple__376;
static PyObject *__pyx_tuple__379;
static PyObject *__pyx_tuple__381;
static PyObject *__pyx_tuple__383;
static PyObject *__pyx_tuple__385;
static PyObject *__pyx_tuple__387;
static PyObject *__pyx_tuple__389;
static PyObject *__pyx_tuple__391;
static PyObject *__pyx_tuple__393;
static PyObject *__pyx_tuple__395;
static PyObject *__pyx_tuple__397;
static PyObject *__pyx_tuple__399;
static PyObject *__pyx_tuple__401;
static PyObject *__pyx_tuple__403;
static PyObject *__pyx_tuple__405;
static PyObject *__pyx_tuple__407;
static PyObject *__pyx_tuple__409;
static PyObject *__pyx_tuple__411;
static PyObject *__pyx_tuple__413;
static PyObject *__pyx_tuple__415;
static PyObject *__pyx_tuple__417;
static PyObject *__pyx_tuple__419;
static PyObject *__pyx_tuple__421;
static PyObject *__pyx_tuple__423;
static PyObject *__pyx_tuple__425;
static PyObject *__pyx_tuple__427;
static PyObject *__pyx_codeobj__21;
static PyObject *__pyx_codeobj__150;
static PyObject *__pyx_codeobj__151;
static PyObject *__pyx_codeobj__153;
static PyObject *__pyx_codeobj__155;
static PyObject *__pyx_codeobj__234;
static PyObject *__pyx_codeobj__236;
static PyObject *__pyx_codeobj__238;
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__251;
static PyObject *__pyx_codeobj__253;
static PyObject *__pyx_codeobj__254;
static PyObject *__pyx_codeobj__255;
static PyObject *__pyx_codeobj__256;
static PyObject *__pyx_codeobj__257;
static PyObject *__pyx_codeobj__258;
static PyObject *__pyx_codeobj__259;
static PyObject *__pyx_codeobj__260;
static PyObject *__pyx_codeobj__261;
static PyObject *__pyx_codeobj__262;
static PyObject *__pyx_codeobj__263;
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__275;
static PyObject *__pyx_codeobj__276;
static PyObject *__pyx_codeobj__277;
static PyObject *__pyx_codeobj__278;
static PyObject *__pyx_codeobj__279;
static PyObject *__pyx_codeobj__280;
static PyObject *__pyx_codeobj__281;
static PyObject *__pyx_codeobj__283;
static PyObject *__pyx_codeobj__285;
static PyObject *__pyx_codeobj__287;
static PyObject *__pyx_codeobj__293;
static PyObject *__pyx_codeobj__295;
static PyObject *__pyx_codeobj__297;
static PyObject *__pyx_codeobj__299;
static PyObject *__pyx_codeobj__301;
static PyObject *__pyx_codeobj__303;
static PyObject *__pyx_codeobj__305;
static PyObject *__pyx_codeobj__307;
static PyObject *__pyx_codeobj__309;
static PyObject *__pyx_codeobj__311;
static PyObject *__pyx_codeobj__313;
static PyObject *__pyx_codeobj__315;
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;
static PyObject *__pyx_codeobj__361;
static PyObject *__pyx_codeobj__363;
static PyObject *__pyx_codeobj__365;
static PyObject *__pyx_codeobj__367;
static PyObject *__pyx_codeobj__369;
static PyObject *__pyx_codeobj__371;
static PyObject *__pyx_codeobj__373;
static PyObject *__pyx_codeobj__375;
static PyObject *__pyx_codeobj__377;
static PyObject *__pyx_codeobj__378;
static PyObject *__pyx_codeobj__380;
static PyObject *__pyx_codeobj__382;
static PyObject *__pyx_codeobj__384;
static PyObject *__pyx_codeobj__386;
static PyObject *__pyx_codeobj__388;
static PyObject *__pyx_codeobj__390;
static PyObject *__pyx_codeobj__392;
static PyObject *__pyx_codeobj__394;
static PyObject *__pyx_codeobj__396;
static PyObject *__pyx_codeobj__398;
static PyObject *__pyx_codeobj__400;
static PyObject *__pyx_codeobj__402;
static PyObject *__pyx_codeobj__404;
static PyObject *__pyx_codeobj__406;
static PyObject *__pyx_codeobj__408;
static PyObject *__pyx_codeobj__410;
static PyObject *__pyx_codeobj__412;
static PyObject *__pyx_codeobj__414;
static PyObject *__pyx_codeobj__416;
static PyObject *__pyx_codeobj__418;
static PyObject *__pyx_codeobj__420;
static PyObject *__pyx_codeobj__422;
static PyObject *__pyx_codeobj__424;
static PyObject *__pyx_codeobj__426;
static PyObject *__pyx_codeobj__428;
/* Late includes */

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

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

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

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

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

  /* "pyarrow/lib.pyx":42
 * 
 * 
 * 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":55
 * 
 * 
 * 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(8, 55, __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":59
 *     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":60
 *     """
 *     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(8, 60, __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(8, 60, __pyx_L1_error)

    /* "pyarrow/lib.pyx":59
 *     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":61
 *     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(8, 61, __pyx_L1_error)

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

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

/* "pyarrow/pandas-shim.pxi":36
 *         object _array_like_types
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self._tried_importing_pandas = False
 *         self._have_pandas = 0
 */

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

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

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

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

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

  /* "pyarrow/pandas-shim.pxi":36
 *         object _array_like_types
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self._tried_importing_pandas = False
 *         self._have_pandas = 0
 */

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  /* "pyarrow/pandas-shim.pxi":51
 *                 return
 * 
 *         self._pd = pd             # <<<<<<<<<<<<<<
 *         self._compat_module = pdcompat
 *         self._data_frame = pd.DataFrame
 */
  __Pyx_INCREF(__pyx_v_pd);
  __Pyx_GIVEREF(__pyx_v_pd);
  __Pyx_GOTREF(__pyx_v_self->_pd);
  __Pyx_DECREF(__pyx_v_self->_pd);
  __pyx_v_self->_pd = __pyx_v_pd;

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

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

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

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

  /* "pyarrow/pandas-shim.pxi":56
 *         self._index = pd.Index
 *         self._categorical_type = pd.Categorical
 *         self._series = pd.Series             # <<<<<<<<<<<<<<
 * 
 *         self._array_like_types = (self._series, self._index,
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_pd, __pyx_n_s_Series); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  __Pyx_GOTREF(__pyx_v_self->_series);
  __Pyx_DECREF(__pyx_v_self->_series);
  __pyx_v_self->_series = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "pyarrow/pandas-shim.pxi":58
 *         self._series = pd.Series
 * 
 *         self._array_like_types = (self._series, self._index,             # <<<<<<<<<<<<<<
 *                                   self._categorical_type)
 * 
 */
  __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_v_self->_series);
  __Pyx_GIVEREF(__pyx_v_self->_series);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_self->_series);
  __Pyx_INCREF(__pyx_v_self->_index);
  __Pyx_GIVEREF(__pyx_v_self->_index);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_self->_index);
  __Pyx_INCREF(__pyx_v_self->_categorical_type);
  __Pyx_GIVEREF(__pyx_v_self->_categorical_type);
  PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_self->_categorical_type);
  __Pyx_GIVEREF(__pyx_t_7);
  __Pyx_GOTREF(__pyx_v_self->_array_like_types);
  __Pyx_DECREF(__pyx_v_self->_array_like_types);
  __pyx_v_self->_array_like_types = __pyx_t_7;
  __pyx_t_7 = 0;

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

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

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

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

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

    /* "pyarrow/pandas-shim.pxi":63
 *         from distutils.version import LooseVersion
 *         self._loose_version = LooseVersion(pd.__version__)
 *         if self._loose_version >= LooseVersion('0.20.0'):             # <<<<<<<<<<<<<<
 *             from pandas.api.types import DatetimeTZDtype
 *             self._types_api = pd.api.types
 */
    goto __pyx_L12;
  }

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

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

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

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

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

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

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

  /* "pyarrow/pandas-shim.pxi":74
 * 
 *         self._datetimetz_type = DatetimeTZDtype
 *         self._have_pandas = True             # <<<<<<<<<<<<<<
 * 
 *     cdef inline _check_import(self, bint raise_=True):
 */
  __pyx_v_self->_have_pandas = 1;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* "pyarrow/pandas-shim.pxi":125
 * 
 *     @property
 *     def version(self):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._version
 */

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

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

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

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

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

  /* "pyarrow/pandas-shim.pxi":125
 * 
 *     @property
 *     def version(self):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._version
 */

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

/* "pyarrow/pandas-shim.pxi":130
 * 
 *     @property
 *     def categorical_type(self):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._categorical_type
 */

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

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

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

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

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

  /* "pyarrow/pandas-shim.pxi":130
 * 
 *     @property
 *     def categorical_type(self):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._categorical_type
 */

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

/* "pyarrow/pandas-shim.pxi":135
 * 
 *     @property
 *     def datetimetz_type(self):             # <<<<<<<<<<<<<<
 *         return self._datetimetz_type
 * 
 */

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

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

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

  /* "pyarrow/pandas-shim.pxi":136
 *     @property
 *     def datetimetz_type(self):
 *         return self._datetimetz_type             # <<<<<<<<<<<<<<
 * 
 *     cpdef is_array_like(self, obj):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_datetimetz_type);
  __pyx_r = __pyx_v_self->_datetimetz_type;
  goto __pyx_L0;

  /* "pyarrow/pandas-shim.pxi":135
 * 
 *     @property
 *     def datetimetz_type(self):             # <<<<<<<<<<<<<<
 *         return self._datetimetz_type
 * 
 */

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

/* "pyarrow/pandas-shim.pxi":138
 *         return self._datetimetz_type
 * 
 *     cpdef is_array_like(self, obj):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return isinstance(obj, self._array_like_types)
 */

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

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

  /* "pyarrow/pandas-shim.pxi":140
 *     cpdef is_array_like(self, obj):
 *         self._check_import()
 *         return isinstance(obj, self._array_like_types)             # <<<<<<<<<<<<<<
 * 
 *     cpdef is_categorical(self, obj):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_v_self->_array_like_types;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_5 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(3, 140, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/pandas-shim.pxi":138
 *         return self._datetimetz_type
 * 
 *     cpdef is_array_like(self, obj):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return isinstance(obj, self._array_like_types)
 */

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_9is_array_like(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_8is_array_like[] = "_PandasAPIShim.is_array_like(self, obj)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_9is_array_like(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_array_like (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_8is_array_like(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_8is_array_like(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("is_array_like", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_array_like(__pyx_v_self, __pyx_v_obj, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "pyarrow/pandas-shim.pxi":142
 *         return isinstance(obj, self._array_like_types)
 * 
 *     cpdef is_categorical(self, obj):             # <<<<<<<<<<<<<<
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._categorical_type)
 */

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

  /* "pyarrow/pandas-shim.pxi":143
 * 
 *     cpdef is_categorical(self, obj):
 *         if self._have_pandas_internal():             # <<<<<<<<<<<<<<
 *             return isinstance(obj, self._categorical_type)
 *         else:
 */
  __pyx_t_5 = (__pyx_f_7pyarrow_3lib_14_PandasAPIShim__have_pandas_internal(__pyx_v_self) != 0);
  if (__pyx_t_5) {

    /* "pyarrow/pandas-shim.pxi":144
 *     cpdef is_categorical(self, obj):
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._categorical_type)             # <<<<<<<<<<<<<<
 *         else:
 *             return False
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_v_self->_categorical_type;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_5 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(3, 144, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "pyarrow/pandas-shim.pxi":143
 * 
 *     cpdef is_categorical(self, obj):
 *         if self._have_pandas_internal():             # <<<<<<<<<<<<<<
 *             return isinstance(obj, self._categorical_type)
 *         else:
 */
  }

  /* "pyarrow/pandas-shim.pxi":146
 *             return isinstance(obj, self._categorical_type)
 *         else:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *     cpdef is_datetimetz(self, obj):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }

  /* "pyarrow/pandas-shim.pxi":142
 *         return isinstance(obj, self._array_like_types)
 * 
 *     cpdef is_categorical(self, obj):             # <<<<<<<<<<<<<<
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._categorical_type)
 */

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_11is_categorical(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_10is_categorical[] = "_PandasAPIShim.is_categorical(self, obj)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_11is_categorical(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_categorical (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_10is_categorical(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_10is_categorical(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("is_categorical", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_categorical(__pyx_v_self, __pyx_v_obj, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "pyarrow/pandas-shim.pxi":148
 *             return False
 * 
 *     cpdef is_datetimetz(self, obj):             # <<<<<<<<<<<<<<
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._datetimetz_type)
 */

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

  /* "pyarrow/pandas-shim.pxi":149
 * 
 *     cpdef is_datetimetz(self, obj):
 *         if self._have_pandas_internal():             # <<<<<<<<<<<<<<
 *             return isinstance(obj, self._datetimetz_type)
 *         else:
 */
  __pyx_t_5 = (__pyx_f_7pyarrow_3lib_14_PandasAPIShim__have_pandas_internal(__pyx_v_self) != 0);
  if (__pyx_t_5) {

    /* "pyarrow/pandas-shim.pxi":150
 *     cpdef is_datetimetz(self, obj):
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._datetimetz_type)             # <<<<<<<<<<<<<<
 *         else:
 *             return False
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_v_self->_datetimetz_type;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_5 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(3, 150, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "pyarrow/pandas-shim.pxi":149
 * 
 *     cpdef is_datetimetz(self, obj):
 *         if self._have_pandas_internal():             # <<<<<<<<<<<<<<
 *             return isinstance(obj, self._datetimetz_type)
 *         else:
 */
  }

  /* "pyarrow/pandas-shim.pxi":152
 *             return isinstance(obj, self._datetimetz_type)
 *         else:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *     cpdef is_data_frame(self, obj):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }

  /* "pyarrow/pandas-shim.pxi":148
 *             return False
 * 
 *     cpdef is_datetimetz(self, obj):             # <<<<<<<<<<<<<<
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._datetimetz_type)
 */

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_13is_datetimetz(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_12is_datetimetz[] = "_PandasAPIShim.is_datetimetz(self, obj)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_13is_datetimetz(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_datetimetz (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_12is_datetimetz(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_12is_datetimetz(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("is_datetimetz", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_datetimetz(__pyx_v_self, __pyx_v_obj, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "pyarrow/pandas-shim.pxi":154
 *             return False
 * 
 *     cpdef is_data_frame(self, obj):             # <<<<<<<<<<<<<<
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._data_frame)
 */

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

  /* "pyarrow/pandas-shim.pxi":155
 * 
 *     cpdef is_data_frame(self, obj):
 *         if self._have_pandas_internal():             # <<<<<<<<<<<<<<
 *             return isinstance(obj, self._data_frame)
 *         else:
 */
  __pyx_t_5 = (__pyx_f_7pyarrow_3lib_14_PandasAPIShim__have_pandas_internal(__pyx_v_self) != 0);
  if (__pyx_t_5) {

    /* "pyarrow/pandas-shim.pxi":156
 *     cpdef is_data_frame(self, obj):
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._data_frame)             # <<<<<<<<<<<<<<
 *         else:
 *             return False
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_v_self->_data_frame;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_5 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(3, 156, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 156, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "pyarrow/pandas-shim.pxi":155
 * 
 *     cpdef is_data_frame(self, obj):
 *         if self._have_pandas_internal():             # <<<<<<<<<<<<<<
 *             return isinstance(obj, self._data_frame)
 *         else:
 */
  }

  /* "pyarrow/pandas-shim.pxi":158
 *             return isinstance(obj, self._data_frame)
 *         else:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *     cpdef is_series(self, obj):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }

  /* "pyarrow/pandas-shim.pxi":154
 *             return False
 * 
 *     cpdef is_data_frame(self, obj):             # <<<<<<<<<<<<<<
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._data_frame)
 */

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_15is_data_frame(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_14is_data_frame[] = "_PandasAPIShim.is_data_frame(self, obj)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_15is_data_frame(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_data_frame (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_14is_data_frame(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_14is_data_frame(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("is_data_frame", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_data_frame(__pyx_v_self, __pyx_v_obj, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "pyarrow/pandas-shim.pxi":160
 *             return False
 * 
 *     cpdef is_series(self, obj):             # <<<<<<<<<<<<<<
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._series)
 */

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

  /* "pyarrow/pandas-shim.pxi":161
 * 
 *     cpdef is_series(self, obj):
 *         if self._have_pandas_internal():             # <<<<<<<<<<<<<<
 *             return isinstance(obj, self._series)
 *         else:
 */
  __pyx_t_5 = (__pyx_f_7pyarrow_3lib_14_PandasAPIShim__have_pandas_internal(__pyx_v_self) != 0);
  if (__pyx_t_5) {

    /* "pyarrow/pandas-shim.pxi":162
 *     cpdef is_series(self, obj):
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._series)             # <<<<<<<<<<<<<<
 *         else:
 *             return False
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_v_self->_series;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_5 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(3, 162, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "pyarrow/pandas-shim.pxi":161
 * 
 *     cpdef is_series(self, obj):
 *         if self._have_pandas_internal():             # <<<<<<<<<<<<<<
 *             return isinstance(obj, self._series)
 *         else:
 */
  }

  /* "pyarrow/pandas-shim.pxi":164
 *             return isinstance(obj, self._series)
 *         else:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *     def assert_frame_equal(self, *args, **kwargs):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }

  /* "pyarrow/pandas-shim.pxi":160
 *             return False
 * 
 *     cpdef is_series(self, obj):             # <<<<<<<<<<<<<<
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._series)
 */

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_17is_series(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_16is_series[] = "_PandasAPIShim.is_series(self, obj)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_17is_series(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_series (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_16is_series(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_16is_series(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("is_series", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_series(__pyx_v_self, __pyx_v_obj, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "pyarrow/pandas-shim.pxi":166
 *             return False
 * 
 *     def assert_frame_equal(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._pd.util.testing.assert_frame_equal
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_19assert_frame_equal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_18assert_frame_equal[] = "_PandasAPIShim.assert_frame_equal(self, *args, **kwargs)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_19assert_frame_equal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_args = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("assert_frame_equal (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "assert_frame_equal", 1))) return NULL;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_18assert_frame_equal(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_18assert_frame_equal(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("assert_frame_equal", 0);

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

  /* "pyarrow/pandas-shim.pxi":168
 *     def assert_frame_equal(self, *args, **kwargs):
 *         self._check_import()
 *         return self._pd.util.testing.assert_frame_equal             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_pd, __pyx_n_s_util); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_testing); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_assert_frame_equal); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/pandas-shim.pxi":166
 *             return False
 * 
 *     def assert_frame_equal(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._pd.util.testing.assert_frame_equal
 */

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

/* "pyarrow/pandas-shim.pxi":30
 * 
 *     cdef readonly:
 *         object _loose_version, _version             # <<<<<<<<<<<<<<
 *         object _pd, _types_api, _compat_module
 *         object _data_frame, _index, _series, _categorical_type
 */

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

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_14_loose_version___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_loose_version);
  __pyx_r = __pyx_v_self->_loose_version;
  goto __pyx_L0;

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

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

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_8_version___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_version);
  __pyx_r = __pyx_v_self->_version;
  goto __pyx_L0;

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

/* "pyarrow/pandas-shim.pxi":31
 *     cdef readonly:
 *         object _loose_version, _version
 *         object _pd, _types_api, _compat_module             # <<<<<<<<<<<<<<
 *         object _data_frame, _index, _series, _categorical_type
 *         object _datetimetz_type
 */

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

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_3_pd___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_pd);
  __pyx_r = __pyx_v_self->_pd;
  goto __pyx_L0;

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

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

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_10_types_api___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_types_api);
  __pyx_r = __pyx_v_self->_types_api;
  goto __pyx_L0;

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

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

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_14_compat_module___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_compat_module);
  __pyx_r = __pyx_v_self->_compat_module;
  goto __pyx_L0;

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

/* "pyarrow/pandas-shim.pxi":32
 *         object _loose_version, _version
 *         object _pd, _types_api, _compat_module
 *         object _data_frame, _index, _series, _categorical_type             # <<<<<<<<<<<<<<
 *         object _datetimetz_type
 *         object _array_like_types
 */

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

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_11_data_frame___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_data_frame);
  __pyx_r = __pyx_v_self->_data_frame;
  goto __pyx_L0;

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

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

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_6_index___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_index);
  __pyx_r = __pyx_v_self->_index;
  goto __pyx_L0;

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

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

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_7_series___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_series);
  __pyx_r = __pyx_v_self->_series;
  goto __pyx_L0;

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

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

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_17_categorical_type___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_categorical_type);
  __pyx_r = __pyx_v_self->_categorical_type;
  goto __pyx_L0;

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

/* "pyarrow/pandas-shim.pxi":33
 *         object _pd, _types_api, _compat_module
 *         object _data_frame, _index, _series, _categorical_type
 *         object _datetimetz_type             # <<<<<<<<<<<<<<
 *         object _array_like_types
 * 
 */

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

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_16_datetimetz_type___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_datetimetz_type);
  __pyx_r = __pyx_v_self->_datetimetz_type;
  goto __pyx_L0;

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

/* "pyarrow/pandas-shim.pxi":34
 *         object _data_frame, _index, _series, _categorical_type
 *         object _datetimetz_type
 *         object _array_like_types             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self):
 */

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

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_17_array_like_types___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_array_like_types);
  __pyx_r = __pyx_v_self->_array_like_types;
  goto __pyx_L0;

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

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_20__reduce_cython__[] = "_PandasAPIShim.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_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_14_PandasAPIShim_20__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_20__reduce_cython__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self._array_like_types, self._categorical_type, self._compat_module, self._data_frame, self._datetimetz_type, self._have_pandas, self._index, self._loose_version, self._pd, self._series, self._tried_importing_pandas, self._types_api, self._version)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_have_pandas); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->_tried_importing_pandas); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(13); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_self->_array_like_types);
  __Pyx_GIVEREF(__pyx_v_self->_array_like_types);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->_array_like_types);
  __Pyx_INCREF(__pyx_v_self->_categorical_type);
  __Pyx_GIVEREF(__pyx_v_self->_categorical_type);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->_categorical_type);
  __Pyx_INCREF(__pyx_v_self->_compat_module);
  __Pyx_GIVEREF(__pyx_v_self->_compat_module);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_self->_compat_module);
  __Pyx_INCREF(__pyx_v_self->_data_frame);
  __Pyx_GIVEREF(__pyx_v_self->_data_frame);
  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_self->_data_frame);
  __Pyx_INCREF(__pyx_v_self->_datetimetz_type);
  __Pyx_GIVEREF(__pyx_v_self->_datetimetz_type);
  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_self->_datetimetz_type);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->_index);
  __Pyx_GIVEREF(__pyx_v_self->_index);
  PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_v_self->_index);
  __Pyx_INCREF(__pyx_v_self->_loose_version);
  __Pyx_GIVEREF(__pyx_v_self->_loose_version);
  PyTuple_SET_ITEM(__pyx_t_3, 7, __pyx_v_self->_loose_version);
  __Pyx_INCREF(__pyx_v_self->_pd);
  __Pyx_GIVEREF(__pyx_v_self->_pd);
  PyTuple_SET_ITEM(__pyx_t_3, 8, __pyx_v_self->_pd);
  __Pyx_INCREF(__pyx_v_self->_series);
  __Pyx_GIVEREF(__pyx_v_self->_series);
  PyTuple_SET_ITEM(__pyx_t_3, 9, __pyx_v_self->_series);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 10, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self->_types_api);
  __Pyx_GIVEREF(__pyx_v_self->_types_api);
  PyTuple_SET_ITEM(__pyx_t_3, 11, __pyx_v_self->_types_api);
  __Pyx_INCREF(__pyx_v_self->_version);
  __Pyx_GIVEREF(__pyx_v_self->_version);
  PyTuple_SET_ITEM(__pyx_t_3, 12, __pyx_v_self->_version);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self._array_like_types, self._categorical_type, self._compat_module, self._data_frame, self._datetimetz_type, self._have_pandas, self._index, self._loose_version, self._pd, self._series, self._tried_importing_pandas, self._types_api, self._version)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v__dict = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":7
 *     state = (self._array_like_types, self._categorical_type, self._compat_module, self._data_frame, self._datetimetz_type, self._have_pandas, self._index, self._loose_version, self._pd, self._series, self._tried_importing_pandas, self._types_api, self._version)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_4 = (__pyx_v__dict != Py_None);
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__dict);
    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self._array_like_types is not None or self._categorical_type is not None or self._compat_module is not None or self._data_frame is not None or self._datetimetz_type is not None or self._index is not None or self._loose_version is not None or self._pd is not None or self._series is not None or self._types_api is not None or self._version is not None
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self._array_like_types, self._categorical_type, self._compat_module, self._data_frame, self._datetimetz_type, self._have_pandas, self._index, self._loose_version, self._pd, self._series, self._tried_importing_pandas, self._types_api, self._version)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self._array_like_types is not None or self._categorical_type is not None or self._compat_module is not None or self._data_frame is not None or self._datetimetz_type is not None or self._index is not None or self._loose_version is not None or self._pd is not None or self._series is not None or self._types_api is not None or self._version is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle__PandasAPIShim, (type(self), 0x019bb17, None), state
 */
  /*else*/ {
    __pyx_t_4 = (__pyx_v_self->_array_like_types != Py_None);
    __pyx_t_6 = (__pyx_t_4 != 0);
    if (!__pyx_t_6) {
    } else {
      __pyx_t_5 = __pyx_t_6;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_6 = (__pyx_v_self->_categorical_type != Py_None);
    __pyx_t_4 = (__pyx_t_6 != 0);
    if (!__pyx_t_4) {
    } else {
      __pyx_t_5 = __pyx_t_4;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_4 = (__pyx_v_self->_compat_module != Py_None);
    __pyx_t_6 = (__pyx_t_4 != 0);
    if (!__pyx_t_6) {
    } else {
      __pyx_t_5 = __pyx_t_6;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_6 = (__pyx_v_self->_data_frame != Py_None);
    __pyx_t_4 = (__pyx_t_6 != 0);
    if (!__pyx_t_4) {
    } else {
      __pyx_t_5 = __pyx_t_4;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_4 = (__pyx_v_self->_datetimetz_type != Py_None);
    __pyx_t_6 = (__pyx_t_4 != 0);
    if (!__pyx_t_6) {
    } else {
      __pyx_t_5 = __pyx_t_6;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_6 = (__pyx_v_self->_index != Py_None);
    __pyx_t_4 = (__pyx_t_6 != 0);
    if (!__pyx_t_4) {
    } else {
      __pyx_t_5 = __pyx_t_4;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_4 = (__pyx_v_self->_loose_version != Py_None);
    __pyx_t_6 = (__pyx_t_4 != 0);
    if (!__pyx_t_6) {
    } else {
      __pyx_t_5 = __pyx_t_6;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_6 = (__pyx_v_self->_pd != Py_None);
    __pyx_t_4 = (__pyx_t_6 != 0);
    if (!__pyx_t_4) {
    } else {
      __pyx_t_5 = __pyx_t_4;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_4 = (__pyx_v_self->_series != Py_None);
    __pyx_t_6 = (__pyx_t_4 != 0);
    if (!__pyx_t_6) {
    } else {
      __pyx_t_5 = __pyx_t_6;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_6 = (__pyx_v_self->_types_api != Py_None);
    __pyx_t_4 = (__pyx_t_6 != 0);
    if (!__pyx_t_4) {
    } else {
      __pyx_t_5 = __pyx_t_4;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_4 = (__pyx_v_self->_version != Py_None);
    __pyx_t_6 = (__pyx_t_4 != 0);
    __pyx_t_5 = __pyx_t_6;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_5;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self._array_like_types is not None or self._categorical_type is not None or self._compat_module is not None or self._data_frame is not None or self._datetimetz_type is not None or self._index is not None or self._loose_version is not None or self._pd is not None or self._series is not None or self._types_api is not None or self._version is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle__PandasAPIShim, (type(self), 0x019bb17, None), state
 *     else:
 */
  __pyx_t_5 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_5) {

    /* "(tree fragment)":13
 *         use_setstate = self._array_like_types is not None or self._categorical_type is not None or self._compat_module is not None or self._data_frame is not None or self._datetimetz_type is not None or self._index is not None or self._loose_version is not None or self._pd is not None or self._series is not None or self._types_api is not None or self._version is not None
 *     if use_setstate:
 *         return __pyx_unpickle__PandasAPIShim, (type(self), 0x019bb17, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle__PandasAPIShim, (type(self), 0x019bb17, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pyx_unpickle__PandasAPIShim); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_1686295);
    __Pyx_GIVEREF(__pyx_int_1686295);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_1686295);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self._array_like_types is not None or self._categorical_type is not None or self._compat_module is not None or self._data_frame is not None or self._datetimetz_type is not None or self._index is not None or self._loose_version is not None or self._pd is not None or self._series is not None or self._types_api is not None or self._version is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle__PandasAPIShim, (type(self), 0x019bb17, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle__PandasAPIShim, (type(self), 0x019bb17, None), state
 *     else:
 *         return __pyx_unpickle__PandasAPIShim, (type(self), 0x019bb17, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle__PandasAPIShim__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle__PandasAPIShim); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_1686295);
    __Pyx_GIVEREF(__pyx_int_1686295);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_1686295);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 15, __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;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

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

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle__PandasAPIShim, (type(self), 0x019bb17, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle__PandasAPIShim__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_22__setstate_cython__[] = "_PandasAPIShim.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_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_14_PandasAPIShim_22__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_22__setstate_cython__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle__PandasAPIShim, (type(self), 0x019bb17, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle__PandasAPIShim__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(9, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_7pyarrow_3lib___pyx_unpickle__PandasAPIShim__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle__PandasAPIShim, (type(self), 0x019bb17, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle__PandasAPIShim__set_state(self, __pyx_state)
 */

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

/* "pyarrow/error.pxi":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":31
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, "
 *                         "use pyarrow.*_memory_pool instead."
 */

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

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

static int __pyx_pf_7pyarrow_3lib_10MemoryPool___init__(struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/memory.pxi":34
 *         raise TypeError("Do not call {}'s constructor directly, "
 *                         "use pyarrow.*_memory_pool instead."
 *                         .format(self.__class__.__name__))             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, CMemoryPool* pool):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Do_not_call_s_constructor_direct, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 34, __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(10, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/memory.pxi":32
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call {}'s constructor directly, "             # <<<<<<<<<<<<<<
 *                         "use pyarrow.*_memory_pool instead."
 *                         .format(self.__class__.__name__))
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_ERR(10, 32, __pyx_L1_error)

  /* "pyarrow/memory.pxi":31
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, "
 *                         "use pyarrow.*_memory_pool instead."
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.MemoryPool.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static void __pyx_f_7pyarrow_3lib_10MemoryPool_init(struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_self,  arrow::MemoryPool *__pyx_v_pool) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/memory.pxi":37
 * 
 *     cdef void init(self, CMemoryPool* pool):
 *         self.pool = pool             # <<<<<<<<<<<<<<
 * 
 *     def bytes_allocated(self):
 */
  __pyx_v_self->pool = __pyx_v_pool;

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

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

/* "pyarrow/memory.pxi":39
 *         self.pool = pool
 * 
 *     def bytes_allocated(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of bytes that are currently allocated from this
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10MemoryPool_3bytes_allocated(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10MemoryPool_2bytes_allocated[] = "MemoryPool.bytes_allocated(self)\n\n        Return the number of bytes that are currently allocated from this\n        memory pool.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10MemoryPool_3bytes_allocated(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bytes_allocated (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10MemoryPool_2bytes_allocated(((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_10MemoryPool_2bytes_allocated(struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("bytes_allocated", 0);

  /* "pyarrow/memory.pxi":44
 *         memory pool.
 *         """
 *         return self.pool.bytes_allocated()             # <<<<<<<<<<<<<<
 * 
 *     def max_memory(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->pool->bytes_allocated()); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/memory.pxi":39
 *         self.pool = pool
 * 
 *     def bytes_allocated(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of bytes that are currently allocated from this
 */

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

/* "pyarrow/memory.pxi":46
 *         return self.pool.bytes_allocated()
 * 
 *     def max_memory(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the peak memory allocation in this memory pool.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10MemoryPool_5max_memory(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10MemoryPool_4max_memory[] = "MemoryPool.max_memory(self)\n\n        Return the peak memory allocation in this memory pool.\n        This can be an approximate number in multi-threaded applications.\n\n        None is returned if the pool implementation doesn't know how to\n        compute this number.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10MemoryPool_5max_memory(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("max_memory (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10MemoryPool_4max_memory(((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_10MemoryPool_4max_memory(struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_self) {
  int64_t __pyx_v_ret;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("max_memory", 0);

  /* "pyarrow/memory.pxi":54
 *         compute this number.
 *         """
 *         ret = self.pool.max_memory()             # <<<<<<<<<<<<<<
 *         return ret if ret >= 0 else None
 * 
 */
  __pyx_v_ret = __pyx_v_self->pool->max_memory();

  /* "pyarrow/memory.pxi":55
 *         """
 *         ret = self.pool.max_memory()
 *         return ret if ret >= 0 else None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  if (((__pyx_v_ret >= 0) != 0)) {
    __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 55, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_1 = Py_None;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/memory.pxi":46
 *         return self.pool.bytes_allocated()
 * 
 *     def max_memory(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the peak memory allocation in this memory pool.
 */

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

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10MemoryPool_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10MemoryPool_6__reduce_cython__[] = "MemoryPool.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10MemoryPool_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10MemoryPool_6__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_10MemoryPool_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.pool cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.pool cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.pool cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10MemoryPool_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10MemoryPool_8__setstate_cython__[] = "MemoryPool.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_10MemoryPool_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10MemoryPool_8__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_7pyarrow_3lib_10MemoryPool_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.pool cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.pool cannot be converted to a Python object for pickling")
 */

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

/* "pyarrow/memory.pxi":58
 * 
 * 
 * cdef CMemoryPool* maybe_unbox_memory_pool(MemoryPool memory_pool):             # <<<<<<<<<<<<<<
 *     if memory_pool is None:
 *         return c_get_memory_pool()
 */

static  arrow::MemoryPool *__pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
   arrow::MemoryPool *__pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("maybe_unbox_memory_pool", 0);

  /* "pyarrow/memory.pxi":59
 * 
 * cdef CMemoryPool* maybe_unbox_memory_pool(MemoryPool memory_pool):
 *     if memory_pool is None:             # <<<<<<<<<<<<<<
 *         return c_get_memory_pool()
 *     else:
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_memory_pool) == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/memory.pxi":60
 * cdef CMemoryPool* maybe_unbox_memory_pool(MemoryPool memory_pool):
 *     if memory_pool is None:
 *         return c_get_memory_pool()             # <<<<<<<<<<<<<<
 *     else:
 *         return memory_pool.pool
 */
    __pyx_r =  arrow::py::get_memory_pool();
    goto __pyx_L0;

    /* "pyarrow/memory.pxi":59
 * 
 * cdef CMemoryPool* maybe_unbox_memory_pool(MemoryPool memory_pool):
 *     if memory_pool is None:             # <<<<<<<<<<<<<<
 *         return c_get_memory_pool()
 *     else:
 */
  }

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

  /* "pyarrow/memory.pxi":58
 * 
 * 
 * cdef CMemoryPool* maybe_unbox_memory_pool(MemoryPool memory_pool):             # <<<<<<<<<<<<<<
 *     if memory_pool is None:
 *         return c_get_memory_pool()
 */

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

/* "pyarrow/memory.pxi":69
 *         unique_ptr[CLoggingMemoryPool] logging_pool
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, "
 *                         "use pyarrow.logging_memory_pool instead."
 */

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

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

static int __pyx_pf_7pyarrow_3lib_17LoggingMemoryPool___init__(struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/memory.pxi":72
 *         raise TypeError("Do not call {}'s constructor directly, "
 *                         "use pyarrow.logging_memory_pool instead."
 *                         .format(self.__class__.__name__))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Do_not_call_s_constructor_direct_2, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 72, __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(10, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/memory.pxi":70
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call {}'s constructor directly, "             # <<<<<<<<<<<<<<
 *                         "use pyarrow.logging_memory_pool instead."
 *                         .format(self.__class__.__name__))
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_ERR(10, 70, __pyx_L1_error)

  /* "pyarrow/memory.pxi":69
 *         unique_ptr[CLoggingMemoryPool] logging_pool
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, "
 *                         "use pyarrow.logging_memory_pool instead."
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.LoggingMemoryPool.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_17LoggingMemoryPool_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_17LoggingMemoryPool_2__reduce_cython__[] = "LoggingMemoryPool.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_17LoggingMemoryPool_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_17LoggingMemoryPool_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_17LoggingMemoryPool_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

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

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_17LoggingMemoryPool_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_17LoggingMemoryPool_4__setstate_cython__[] = "LoggingMemoryPool.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_17LoggingMemoryPool_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_17LoggingMemoryPool_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_7pyarrow_3lib_17LoggingMemoryPool_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")
 */

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

/* "pyarrow/memory.pxi":84
 *         unique_ptr[CProxyMemoryPool] proxy_pool
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, "
 *                         "use pyarrow.proxy_memory_pool instead."
 */

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

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

static int __pyx_pf_7pyarrow_3lib_15ProxyMemoryPool___init__(struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/memory.pxi":87
 *         raise TypeError("Do not call {}'s constructor directly, "
 *                         "use pyarrow.proxy_memory_pool instead."
 *                         .format(self.__class__.__name__))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Do_not_call_s_constructor_direct_3, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 87, __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(10, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/memory.pxi":85
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call {}'s constructor directly, "             # <<<<<<<<<<<<<<
 *                         "use pyarrow.proxy_memory_pool instead."
 *                         .format(self.__class__.__name__))
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_ERR(10, 85, __pyx_L1_error)

  /* "pyarrow/memory.pxi":84
 *         unique_ptr[CProxyMemoryPool] proxy_pool
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, "
 *                         "use pyarrow.proxy_memory_pool instead."
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.ProxyMemoryPool.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.pool,self.proxy_pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15ProxyMemoryPool_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15ProxyMemoryPool_2__reduce_cython__[] = "ProxyMemoryPool.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_15ProxyMemoryPool_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15ProxyMemoryPool_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_15ProxyMemoryPool_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.pool,self.proxy_pool cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.pool,self.proxy_pool cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.pool,self.proxy_pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.pool,self.proxy_pool cannot be converted to a Python object for pickling")
 */

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

/* "pyarrow/memory.pxi":90
 * 
 * 
 * def default_memory_pool():             # <<<<<<<<<<<<<<
 *     """
 *     Return the process-global memory pool.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5default_memory_pool(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_4default_memory_pool[] = "default_memory_pool()\n\n    Return the process-global memory pool.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_5default_memory_pool = {"default_memory_pool", (PyCFunction)__pyx_pw_7pyarrow_3lib_5default_memory_pool, METH_NOARGS, __pyx_doc_7pyarrow_3lib_4default_memory_pool};
static PyObject *__pyx_pw_7pyarrow_3lib_5default_memory_pool(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("default_memory_pool (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_4default_memory_pool(__pyx_self);

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

static PyObject *__pyx_pf_7pyarrow_3lib_4default_memory_pool(CYTHON_UNUSED PyObject *__pyx_self) {
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_pool = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("default_memory_pool", 0);

  /* "pyarrow/memory.pxi":95
 *     """
 *     cdef:
 *         MemoryPool pool = MemoryPool.__new__(MemoryPool)             # <<<<<<<<<<<<<<
 *     pool.init(c_get_memory_pool())
 *     return pool
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_MemoryPool(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_MemoryPool), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 95, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/memory.pxi":96
 *     cdef:
 *         MemoryPool pool = MemoryPool.__new__(MemoryPool)
 *     pool.init(c_get_memory_pool())             # <<<<<<<<<<<<<<
 *     return pool
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_MemoryPool *)__pyx_v_pool->__pyx_vtab)->init(__pyx_v_pool,  arrow::py::get_memory_pool());

  /* "pyarrow/memory.pxi":97
 *         MemoryPool pool = MemoryPool.__new__(MemoryPool)
 *     pool.init(c_get_memory_pool())
 *     return pool             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_pool));
  __pyx_r = ((PyObject *)__pyx_v_pool);
  goto __pyx_L0;

  /* "pyarrow/memory.pxi":90
 * 
 * 
 * def default_memory_pool():             # <<<<<<<<<<<<<<
 *     """
 *     Return the process-global memory pool.
 */

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

/* "pyarrow/memory.pxi":100
 * 
 * 
 * def proxy_memory_pool(MemoryPool parent):             # <<<<<<<<<<<<<<
 *     """
 *     Create and return a MemoryPool instance that redirects to the
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_7proxy_memory_pool(PyObject *__pyx_self, PyObject *__pyx_v_parent); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6proxy_memory_pool[] = "proxy_memory_pool(MemoryPool parent)\n\n    Create and return a MemoryPool instance that redirects to the\n    *parent*, but with separate allocation statistics.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_7proxy_memory_pool = {"proxy_memory_pool", (PyCFunction)__pyx_pw_7pyarrow_3lib_7proxy_memory_pool, METH_O, __pyx_doc_7pyarrow_3lib_6proxy_memory_pool};
static PyObject *__pyx_pw_7pyarrow_3lib_7proxy_memory_pool(PyObject *__pyx_self, PyObject *__pyx_v_parent) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("proxy_memory_pool (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "parent", 0))) __PYX_ERR(10, 100, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_6proxy_memory_pool(__pyx_self, ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_v_parent));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6proxy_memory_pool(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_parent) {
  struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *__pyx_v_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("proxy_memory_pool", 0);

  /* "pyarrow/memory.pxi":105
 *     *parent*, but with separate allocation statistics.
 *     """
 *     cdef ProxyMemoryPool out = ProxyMemoryPool.__new__(ProxyMemoryPool)             # <<<<<<<<<<<<<<
 *     out.proxy_pool.reset(new CProxyMemoryPool(parent.pool))
 *     out.init(out.proxy_pool.get())
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_ProxyMemoryPool(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_ProxyMemoryPool), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 105, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/memory.pxi":106
 *     """
 *     cdef ProxyMemoryPool out = ProxyMemoryPool.__new__(ProxyMemoryPool)
 *     out.proxy_pool.reset(new CProxyMemoryPool(parent.pool))             # <<<<<<<<<<<<<<
 *     out.init(out.proxy_pool.get())
 *     return out
 */
  __pyx_v_out->proxy_pool.reset(new  arrow::ProxyMemoryPool(__pyx_v_parent->pool));

  /* "pyarrow/memory.pxi":107
 *     cdef ProxyMemoryPool out = ProxyMemoryPool.__new__(ProxyMemoryPool)
 *     out.proxy_pool.reset(new CProxyMemoryPool(parent.pool))
 *     out.init(out.proxy_pool.get())             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_ProxyMemoryPool *)__pyx_v_out->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_v_out), __pyx_v_out->proxy_pool.get());

  /* "pyarrow/memory.pxi":108
 *     out.proxy_pool.reset(new CProxyMemoryPool(parent.pool))
 *     out.init(out.proxy_pool.get())
 *     return out             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  /* "pyarrow/memory.pxi":100
 * 
 * 
 * def proxy_memory_pool(MemoryPool parent):             # <<<<<<<<<<<<<<
 *     """
 *     Create and return a MemoryPool instance that redirects to the
 */

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

/* "pyarrow/memory.pxi":111
 * 
 * 
 * def logging_memory_pool(MemoryPool parent):             # <<<<<<<<<<<<<<
 *     """
 *     Create and return a MemoryPool instance that redirects to the
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9logging_memory_pool(PyObject *__pyx_self, PyObject *__pyx_v_parent); /*proto*/
static char __pyx_doc_7pyarrow_3lib_8logging_memory_pool[] = "logging_memory_pool(MemoryPool parent)\n\n    Create and return a MemoryPool instance that redirects to the\n    *parent*, but also dumps allocation logs on stderr.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_9logging_memory_pool = {"logging_memory_pool", (PyCFunction)__pyx_pw_7pyarrow_3lib_9logging_memory_pool, METH_O, __pyx_doc_7pyarrow_3lib_8logging_memory_pool};
static PyObject *__pyx_pw_7pyarrow_3lib_9logging_memory_pool(PyObject *__pyx_self, PyObject *__pyx_v_parent) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("logging_memory_pool (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "parent", 0))) __PYX_ERR(10, 111, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_8logging_memory_pool(__pyx_self, ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_v_parent));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8logging_memory_pool(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_parent) {
  struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *__pyx_v_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("logging_memory_pool", 0);

  /* "pyarrow/memory.pxi":116
 *     *parent*, but also dumps allocation logs on stderr.
 *     """
 *     cdef LoggingMemoryPool out = LoggingMemoryPool.__new__(             # <<<<<<<<<<<<<<
 *         LoggingMemoryPool, parent)
 *     out.logging_pool.reset(new CLoggingMemoryPool(parent.pool))
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_parent));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_parent));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_parent));
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_LoggingMemoryPool(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_LoggingMemoryPool), __pyx_t_1, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 116, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/memory.pxi":118
 *     cdef LoggingMemoryPool out = LoggingMemoryPool.__new__(
 *         LoggingMemoryPool, parent)
 *     out.logging_pool.reset(new CLoggingMemoryPool(parent.pool))             # <<<<<<<<<<<<<<
 *     out.init(out.logging_pool.get())
 *     return out
 */
  __pyx_v_out->logging_pool.reset(new  arrow::LoggingMemoryPool(__pyx_v_parent->pool));

  /* "pyarrow/memory.pxi":119
 *         LoggingMemoryPool, parent)
 *     out.logging_pool.reset(new CLoggingMemoryPool(parent.pool))
 *     out.init(out.logging_pool.get())             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_LoggingMemoryPool *)__pyx_v_out->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_v_out), __pyx_v_out->logging_pool.get());

  /* "pyarrow/memory.pxi":120
 *     out.logging_pool.reset(new CLoggingMemoryPool(parent.pool))
 *     out.init(out.logging_pool.get())
 *     return out             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  /* "pyarrow/memory.pxi":111
 * 
 * 
 * def logging_memory_pool(MemoryPool parent):             # <<<<<<<<<<<<<<
 *     """
 *     Create and return a MemoryPool instance that redirects to the
 */

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

/* "pyarrow/memory.pxi":123
 * 
 * 
 * def set_memory_pool(MemoryPool pool):             # <<<<<<<<<<<<<<
 *     c_set_default_memory_pool(pool.pool)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11set_memory_pool(PyObject *__pyx_self, PyObject *__pyx_v_pool); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10set_memory_pool[] = "set_memory_pool(MemoryPool pool)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_11set_memory_pool = {"set_memory_pool", (PyCFunction)__pyx_pw_7pyarrow_3lib_11set_memory_pool, METH_O, __pyx_doc_7pyarrow_3lib_10set_memory_pool};
static PyObject *__pyx_pw_7pyarrow_3lib_11set_memory_pool(PyObject *__pyx_self, PyObject *__pyx_v_pool) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_memory_pool (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "pool", 0))) __PYX_ERR(10, 123, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_10set_memory_pool(__pyx_self, ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_v_pool));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10set_memory_pool(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_pool) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_memory_pool", 0);

  /* "pyarrow/memory.pxi":124
 * 
 * def set_memory_pool(MemoryPool pool):
 *     c_set_default_memory_pool(pool.pool)             # <<<<<<<<<<<<<<
 * 
 * 
 */
   arrow::py::set_default_memory_pool(__pyx_v_pool->pool);

  /* "pyarrow/memory.pxi":123
 * 
 * 
 * def set_memory_pool(MemoryPool pool):             # <<<<<<<<<<<<<<
 *     c_set_default_memory_pool(pool.pool)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/memory.pxi":132
 * 
 * 
 * def log_memory_allocations(enable=True):             # <<<<<<<<<<<<<<
 *     """
 *     Enable or disable memory allocator logging for debugging purposes
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13log_memory_allocations(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12log_memory_allocations[] = "log_memory_allocations(enable=True)\n\n    Enable or disable memory allocator logging for debugging purposes\n\n    Parameters\n    ----------\n    enable : boolean, default True\n        Pass False to disable logging\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_13log_memory_allocations = {"log_memory_allocations", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_13log_memory_allocations, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_12log_memory_allocations};
static PyObject *__pyx_pw_7pyarrow_3lib_13log_memory_allocations(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_enable = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("log_memory_allocations (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_enable,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_enable);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "log_memory_allocations") < 0)) __PYX_ERR(10, 132, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_enable = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("log_memory_allocations", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 132, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.log_memory_allocations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_12log_memory_allocations(__pyx_self, __pyx_v_enable);

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

static PyObject *__pyx_pf_7pyarrow_3lib_12log_memory_allocations(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_enable) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("log_memory_allocations", 0);

  /* "pyarrow/memory.pxi":141
 *         Pass False to disable logging
 *     """
 *     if enable:             # <<<<<<<<<<<<<<
 *         set_memory_pool(_logging_memory_pool)
 *     else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_enable); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(10, 141, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/memory.pxi":142
 *     """
 *     if enable:
 *         set_memory_pool(_logging_memory_pool)             # <<<<<<<<<<<<<<
 *     else:
 *         set_memory_pool(_default_memory_pool)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_set_memory_pool); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_7pyarrow_3lib__logging_memory_pool)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_7pyarrow_3lib__logging_memory_pool));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pyarrow/memory.pxi":141
 *         Pass False to disable logging
 *     """
 *     if enable:             # <<<<<<<<<<<<<<
 *         set_memory_pool(_logging_memory_pool)
 *     else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/memory.pxi":144
 *         set_memory_pool(_logging_memory_pool)
 *     else:
 *         set_memory_pool(_default_memory_pool)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_set_memory_pool); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_7pyarrow_3lib__default_memory_pool)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_7pyarrow_3lib__default_memory_pool));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "pyarrow/memory.pxi":132
 * 
 * 
 * def log_memory_allocations(enable=True):             # <<<<<<<<<<<<<<
 *     """
 *     Enable or disable memory allocator logging for debugging purposes
 */

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

/* "pyarrow/memory.pxi":147
 * 
 * 
 * def total_allocated_bytes():             # <<<<<<<<<<<<<<
 *     """
 *     Return the currently allocated bytes from the default memory pool.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15total_allocated_bytes(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14total_allocated_bytes[] = "total_allocated_bytes()\n\n    Return the currently allocated bytes from the default memory pool.\n    Other memory pools may not be accounted for.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_15total_allocated_bytes = {"total_allocated_bytes", (PyCFunction)__pyx_pw_7pyarrow_3lib_15total_allocated_bytes, METH_NOARGS, __pyx_doc_7pyarrow_3lib_14total_allocated_bytes};
static PyObject *__pyx_pw_7pyarrow_3lib_15total_allocated_bytes(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("total_allocated_bytes (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14total_allocated_bytes(__pyx_self);

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

static PyObject *__pyx_pf_7pyarrow_3lib_14total_allocated_bytes(CYTHON_UNUSED PyObject *__pyx_self) {
   arrow::MemoryPool *__pyx_v_pool;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("total_allocated_bytes", 0);

  /* "pyarrow/memory.pxi":152
 *     Other memory pools may not be accounted for.
 *     """
 *     cdef CMemoryPool* pool = c_get_memory_pool()             # <<<<<<<<<<<<<<
 *     return pool.bytes_allocated()
 */
  __pyx_v_pool =  arrow::py::get_memory_pool();

  /* "pyarrow/memory.pxi":153
 *     """
 *     cdef CMemoryPool* pool = c_get_memory_pool()
 *     return pool.bytes_allocated()             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_pool->bytes_allocated()); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/memory.pxi":147
 * 
 * 
 * def total_allocated_bytes():             # <<<<<<<<<<<<<<
 *     """
 *     Return the currently allocated bytes from the default memory pool.
 */

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

/* "pyarrow/types.pxi":63
 * 
 * 
 * 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":68
 *     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":69
 *     """
 *     try:
 *         char = _pep3118_type_map[type.id()]             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         return None
 */
      if (unlikely(__pyx_v_7pyarrow_3lib__pep3118_type_map == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(4, 69, __pyx_L3_error)
      }
      __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type(__pyx_v_type->id()); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 69, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_7pyarrow_3lib__pep3118_type_map, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 69, __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":68
 *     None is returned for unsupported types.
 *     """
 *     try:             # <<<<<<<<<<<<<<
 *         char = _pep3118_type_map[type.id()]
 *     except KeyError:
 */
    }

    /* "pyarrow/types.pxi":73
 *         return None
 *     else:
 *         if char in b'bBhHiIqQ':             # <<<<<<<<<<<<<<
 *             # Use "standard" int widths, not native
 *             return b'=' + char
 */
    /*else:*/ {
      __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_v_char, __pyx_n_b_bBhHiIqQ, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 73, __pyx_L5_except_error)
      __pyx_t_7 = (__pyx_t_6 != 0);
      if (__pyx_t_7) {

        /* "pyarrow/types.pxi":75
 *         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__9, __pyx_v_char); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 75, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(4, 75, __pyx_L5_except_error)
        __pyx_r = ((PyObject*)__pyx_t_5);
        __pyx_t_5 = 0;
        goto __pyx_L6_except_return;

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

      /* "pyarrow/types.pxi":77
 *             return b'=' + char
 *         else:
 *             return char             # <<<<<<<<<<<<<<
 * 
 * 
 */
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        if (!(likely(PyBytes_CheckExact(__pyx_v_char))||((__pyx_v_char) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_char)->tp_name), 0))) __PYX_ERR(4, 77, __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":70
 *     try:
 *         char = _pep3118_type_map[type.id()]
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         return None
 *     else:
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_8) {
      __Pyx_AddTraceback("pyarrow.lib._datatype_to_pep3118", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_9) < 0) __PYX_ERR(4, 70, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_9);

      /* "pyarrow/types.pxi":71
 *         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":68
 *     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":63
 * 
 * 
 * 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":80
 * 
 * 
 * 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_17_is_primitive(PyObject *__pyx_self, PyObject *__pyx_arg_type); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16_is_primitive[] = "_is_primitive(Type type)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_17_is_primitive = {"_is_primitive", (PyCFunction)__pyx_pw_7pyarrow_3lib_17_is_primitive, METH_O, __pyx_doc_7pyarrow_3lib_16_is_primitive};
static PyObject *__pyx_pw_7pyarrow_3lib_17_is_primitive(PyObject *__pyx_self, PyObject *__pyx_arg_type) {
  enum  arrow::Type::type __pyx_v_type;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_is_primitive (wrapper)", 0);
  assert(__pyx_arg_type); {
    __pyx_v_type = ((enum  arrow::Type::type)__Pyx_PyInt_As_enum____arrow_3a__3a_Type_3a__3a_type(__pyx_arg_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 80, __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_16_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_16_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":82
 * def _is_primitive(Type type):
 *     # This is simply a redirect, the official API is in pyarrow.types.
 *     return is_primitive(type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(arrow::is_primitive(__pyx_v_type)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":80
 * 
 * 
 * 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":96
 *     Each data type is an *instance* of this class.
 *     """
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

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

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

static int __pyx_pf_7pyarrow_3lib_8DataType___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

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

/* "pyarrow/types.pxi":99
 *         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":102
 *         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_u_Do_not_call_s_constructor_direct_4, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 102, __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(4, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":100
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call {}'s constructor directly, use public "             # <<<<<<<<<<<<<<
 *                         "functions like pyarrow.int64, pyarrow.list_, etc. "
 *                         "instead.".format(self.__class__.__name__))
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 100, __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, 100, __pyx_L1_error)

  /* "pyarrow/types.pxi":99
 *         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":104
 *                         "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":105
 * 
 *     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":106
 *     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":107
 *         self.sp_type = type
 *         self.type = type.get()
 *         self.pep3118_format = _datatype_to_pep3118(self.type)             # <<<<<<<<<<<<<<
 * 
 *     cdef Field child(self, int i):
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__datatype_to_pep3118(__pyx_v_self->type); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 107, __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":104
 *                         "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":109
 *         self.pep3118_format = _datatype_to_pep3118(self.type)
 * 
 *     cdef Field child(self, int i):             # <<<<<<<<<<<<<<
 *         cdef int index = <int> _normalize_index(i, self.type.num_children())
 *         return pyarrow_wrap_field(self.type.child(index))
 */

static struct __pyx_obj_7pyarrow_3lib_Field *__pyx_f_7pyarrow_3lib_8DataType_child(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self, int __pyx_v_i) {
  int __pyx_v_index;
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("child", 0);

  /* "pyarrow/types.pxi":110
 * 
 *     cdef Field child(self, int i):
 *         cdef int index = <int> _normalize_index(i, self.type.num_children())             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_field(self.type.child(index))
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__normalize_index(__pyx_v_i, __pyx_v_self->type->num_children()); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1L))) __PYX_ERR(4, 110, __pyx_L1_error)
  __pyx_v_index = ((int)__pyx_t_1);

  /* "pyarrow/types.pxi":111
 *     cdef Field child(self, int i):
 *         cdef int index = <int> _normalize_index(i, self.type.num_children())
 *         return pyarrow_wrap_field(self.type.child(index))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_field(__pyx_v_self->type->child(__pyx_v_index)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(4, 111, __pyx_L1_error)
  __pyx_r = ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":109
 *         self.pep3118_format = _datatype_to_pep3118(self.type)
 * 
 *     cdef Field child(self, int i):             # <<<<<<<<<<<<<<
 *         cdef int index = <int> _normalize_index(i, self.type.num_children())
 *         return pyarrow_wrap_field(self.type.child(index))
 */

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

/* "pyarrow/types.pxi":114
 * 
 *     @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":115
 *     @property
 *     def id(self):
 *         return self.type.id()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type(__pyx_v_self->type->id()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":114
 * 
 *     @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":118
 * 
 *     @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":120
 *     def bit_width(self):
 *         cdef _CFixedWidthTypePtr ty
 *         ty = dynamic_cast[_CFixedWidthTypePtr](self.type)             # <<<<<<<<<<<<<<
 *         if ty == nullptr:
 *             raise ValueError("Non-fixed width type")
 */
  try {
    __pyx_t_1 = dynamic_cast<__pyx_t_7pyarrow_3lib__CFixedWidthTypePtr>(__pyx_v_self->type);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(4, 120, __pyx_L1_error)
  }
  __pyx_v_ty = __pyx_t_1;

  /* "pyarrow/types.pxi":121
 *         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":122
 *         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__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 122, __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, 122, __pyx_L1_error)

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

  /* "pyarrow/types.pxi":118
 * 
 *     @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":125
 *         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":126
 * 
 *     def __str__(self):
 *         return frombytes(self.type.ToString())             # <<<<<<<<<<<<<<
 * 
 *     def __hash__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->type->ToString()); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 126, __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":125
 *         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":128
 *         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":129
 * 
 *     def __hash__(self):
 *         return hash(str(self))             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_hash_t)-1))) __PYX_ERR(4, 129, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":128
 *         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":131
 *         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":132
 * 
 *     def __reduce__(self):
 *         return type_for_alias, (str(self),)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_type_for_alias); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 132, __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":131
 *         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":134
 *         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":135
 * 
 *     def __repr__(self):
 *         return '{0.__class__.__name__}({0})'.format(self)             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_0___class_____name___0, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self));
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 135, __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":134
 *         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":137
 *         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":138
 * 
 *     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":139
 *     def __eq__(self, other):
 *         try:
 *             return self.equals(other)             # <<<<<<<<<<<<<<
 *         except (TypeError, ValueError):
 *             return NotImplemented
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_equals); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 139, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_other);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 139, __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":138
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except (TypeError, ValueError):
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/types.pxi":140
 *         try:
 *             return self.equals(other)
 *         except (TypeError, ValueError):             # <<<<<<<<<<<<<<
 *             return NotImplemented
 * 
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pyarrow.lib.DataType.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(4, 140, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "pyarrow/types.pxi":141
 *             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":138
 * 
 *     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":137
 *         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":143
 *             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":157
 *         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":158
 * 
 *         if not isinstance(other, DataType):
 *             if not isinstance(other, six.string_types):             # <<<<<<<<<<<<<<
 *                 raise TypeError(other)
 *             other_type = type_for_alias(other)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_six); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 158, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_string_types); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 158, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = PyObject_IsInstance(__pyx_v_other, __pyx_t_4); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(4, 158, __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":159
 *         if not isinstance(other, DataType):
 *             if not isinstance(other, six.string_types):
 *                 raise TypeError(other)             # <<<<<<<<<<<<<<
 *             other_type = type_for_alias(other)
 *         else:
 */
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_v_other); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 159, __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, 159, __pyx_L1_error)

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

    /* "pyarrow/types.pxi":160
 *             if not isinstance(other, six.string_types):
 *                 raise TypeError(other)
 *             other_type = type_for_alias(other)             # <<<<<<<<<<<<<<
 *         else:
 *             other_type = other
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_type_for_alias); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_other);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(4, 160, __pyx_L1_error)
    __pyx_v_other_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/types.pxi":157
 *         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":162
 *             other_type = type_for_alias(other)
 *         else:
 *             other_type = other             # <<<<<<<<<<<<<<
 * 
 *         return self.type.Equals(deref(other_type.type))
 */
  /*else*/ {
    if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(4, 162, __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":164
 *             other_type = other
 * 
 *         return self.type.Equals(deref(other_type.type))             # <<<<<<<<<<<<<<
 * 
 *     def to_pandas_dtype(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_self->type->Equals((*__pyx_v_other_type->type))); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":143
 *             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":166
 *         return self.type.Equals(deref(other_type.type))
 * 
 *     def to_pandas_dtype(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the equivalent NumPy / Pandas dtype.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_17to_pandas_dtype(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_8DataType_16to_pandas_dtype[] = "DataType.to_pandas_dtype(self)\n\n        Return the equivalent NumPy / Pandas dtype.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_17to_pandas_dtype(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_pandas_dtype (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8DataType_16to_pandas_dtype(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_16to_pandas_dtype(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self) {
  enum  arrow::Type::type __pyx_v_type_id;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("to_pandas_dtype", 0);

  /* "pyarrow/types.pxi":170
 *         Return the equivalent NumPy / Pandas dtype.
 *         """
 *         cdef Type type_id = self.type.id()             # <<<<<<<<<<<<<<
 *         if type_id in _pandas_type_map:
 *             return _pandas_type_map[type_id]
 */
  __pyx_v_type_id = __pyx_v_self->type->id();

  /* "pyarrow/types.pxi":171
 *         """
 *         cdef Type type_id = self.type.id()
 *         if type_id in _pandas_type_map:             # <<<<<<<<<<<<<<
 *             return _pandas_type_map[type_id]
 *         else:
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type(__pyx_v_type_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(__pyx_v_7pyarrow_3lib__pandas_type_map == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(4, 171, __pyx_L1_error)
  }
  __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_t_1, __pyx_v_7pyarrow_3lib__pandas_type_map, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 171, __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":172
 *         cdef Type type_id = self.type.id()
 *         if type_id in _pandas_type_map:
 *             return _pandas_type_map[type_id]             # <<<<<<<<<<<<<<
 *         else:
 *             raise NotImplementedError(str(self))
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(__pyx_v_7pyarrow_3lib__pandas_type_map == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(4, 172, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type(__pyx_v_type_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 172, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_7pyarrow_3lib__pandas_type_map, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 172, __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":171
 *         """
 *         cdef Type type_id = self.type.id()
 *         if type_id in _pandas_type_map:             # <<<<<<<<<<<<<<
 *             return _pandas_type_map[type_id]
 *         else:
 */
  }

  /* "pyarrow/types.pxi":174
 *             return _pandas_type_map[type_id]
 *         else:
 *             raise NotImplementedError(str(self))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 174, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 174, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 174, __pyx_L1_error)
  }

  /* "pyarrow/types.pxi":166
 *         return self.type.Equals(deref(other_type.type))
 * 
 *     def to_pandas_dtype(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the equivalent NumPy / Pandas dtype.
 */

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

/* "pyarrow/types.pxi":182
 *     """
 * 
 *     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":183
 * 
 *     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":184
 *     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":182
 *     """
 * 
 *     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":186
 *         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":187
 * 
 *     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(4, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_index_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 187, __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(4, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ordered); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 187, __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":186
 *         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":190
 * 
 *     @property
 *     def ordered(self):             # <<<<<<<<<<<<<<
 *         """
 *         Whether the dictionary is ordered, i.e. whether the ordering of values
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14DictionaryType_7ordered_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14DictionaryType_7ordered_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14DictionaryType_7ordered___get__(((struct __pyx_obj_7pyarrow_3lib_DictionaryType *)__pyx_v_self));

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

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

  /* "pyarrow/types.pxi":195
 *         in the dictionary is important.
 *         """
 *         return self.dict_type.ordered()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->dict_type->ordered()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":190
 * 
 *     @property
 *     def ordered(self):             # <<<<<<<<<<<<<<
 *         """
 *         Whether the dictionary is ordered, i.e. whether the ordering of values
 */

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

/* "pyarrow/types.pxi":198
 * 
 *     @property
 *     def index_type(self):             # <<<<<<<<<<<<<<
 *         """
 *         The data type of dictionary indices (a signed integer type).
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14DictionaryType_10index_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14DictionaryType_10index_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14DictionaryType_10index_type___get__(((struct __pyx_obj_7pyarrow_3lib_DictionaryType *)__pyx_v_self));

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

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

  /* "pyarrow/types.pxi":202
 *         The data type of dictionary indices (a signed integer type).
 *         """
 *         return pyarrow_wrap_data_type(self.dict_type.index_type())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_self->dict_type->index_type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":198
 * 
 *     @property
 *     def index_type(self):             # <<<<<<<<<<<<<<
 *         """
 *         The data type of dictionary indices (a signed integer type).
 */

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

/* "pyarrow/types.pxi":205
 * 
 *     @property
 *     def dictionary(self):             # <<<<<<<<<<<<<<
 *         """
 *         The dictionary array, mapping dictionary indices to values.
 */

/* 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":209
 *         The dictionary array, mapping dictionary indices to values.
 *         """
 *         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(4, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":205
 * 
 *     @property
 *     def dictionary(self):             # <<<<<<<<<<<<<<
 *         """
 *         The dictionary array, mapping dictionary indices to values.
 */

  /* 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":217
 *     """
 * 
 *     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":218
 * 
 *     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":219
 *     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":217
 *     """
 * 
 *     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":221
 *         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":222
 * 
 *     def __reduce__(self):
 *         return list_, (self.value_type,)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 222, __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":221
 *         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":225
 * 
 *     @property
 *     def value_type(self):             # <<<<<<<<<<<<<<
 *         """
 *         The data type of list values.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8ListType_10value_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_8ListType_10value_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8ListType_10value_type___get__(((struct __pyx_obj_7pyarrow_3lib_ListType *)__pyx_v_self));

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

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

  /* "pyarrow/types.pxi":229
 *         The data type of list values.
 *         """
 *         return pyarrow_wrap_data_type(self.list_type.value_type())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_self->list_type->value_type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":225
 * 
 *     @property
 *     def value_type(self):             # <<<<<<<<<<<<<<
 *         """
 *         The data type of list values.
 */

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

/* "pyarrow/types.pxi":237
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.struct_type = <const CStructType*> type.get()
 */

static void __pyx_f_7pyarrow_3lib_10StructType_init(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/types.pxi":238
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):
 *         DataType.init(self, type)             # <<<<<<<<<<<<<<
 *         self.struct_type = <const CStructType*> type.get()
 * 
 */
  __pyx_f_7pyarrow_3lib_8DataType_init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), __pyx_v_type);

  /* "pyarrow/types.pxi":239
 *     cdef void init(self, const shared_ptr[CDataType]& type):
 *         DataType.init(self, type)
 *         self.struct_type = <const CStructType*> type.get()             # <<<<<<<<<<<<<<
 * 
 *     cdef Field field(self, int i):
 */
  __pyx_v_self->struct_type = (( arrow::StructType const *)__pyx_v_type.get());

  /* "pyarrow/types.pxi":237
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.struct_type = <const CStructType*> type.get()
 */

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

/* "pyarrow/types.pxi":241
 *         self.struct_type = <const CStructType*> type.get()
 * 
 *     cdef Field field(self, int i):             # <<<<<<<<<<<<<<
 *         """
 *         Return a child field by its index.
 */

static struct __pyx_obj_7pyarrow_3lib_Field *__pyx_f_7pyarrow_3lib_10StructType_field(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self, int __pyx_v_i) {
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("field", 0);

  /* "pyarrow/types.pxi":245
 *         Return a child field by its index.
 *         """
 *         return self.child(i)             # <<<<<<<<<<<<<<
 * 
 *     cdef Field field_by_name(self, name):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7pyarrow_3lib_StructType *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.child(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), __pyx_v_i)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":241
 *         self.struct_type = <const CStructType*> type.get()
 * 
 *     cdef Field field(self, int i):             # <<<<<<<<<<<<<<
 *         """
 *         Return a child field by its index.
 */

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

/* "pyarrow/types.pxi":247
 *         return self.child(i)
 * 
 *     cdef Field field_by_name(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Return a child field by its name rather than its index.
 */

static struct __pyx_obj_7pyarrow_3lib_Field *__pyx_f_7pyarrow_3lib_10StructType_field_by_name(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self, PyObject *__pyx_v_name) {
  std::vector<std::shared_ptr< arrow::Field> >  __pyx_v_fields;
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("field_by_name", 0);

  /* "pyarrow/types.pxi":253
 *         cdef vector[shared_ptr[CField]] fields
 * 
 *         fields = self.struct_type.GetAllFieldsByName(tobytes(name))             # <<<<<<<<<<<<<<
 *         if fields.size() == 0:
 *             raise KeyError(name)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_name);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 253, __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, 253, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_fields = __pyx_v_self->struct_type->GetAllFieldsByName(__pyx_t_4);

  /* "pyarrow/types.pxi":254
 * 
 *         fields = self.struct_type.GetAllFieldsByName(tobytes(name))
 *         if fields.size() == 0:             # <<<<<<<<<<<<<<
 *             raise KeyError(name)
 *         elif fields.size() > 1:
 */
  __pyx_t_5 = ((__pyx_v_fields.size() == 0) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "pyarrow/types.pxi":255
 *         fields = self.struct_type.GetAllFieldsByName(tobytes(name))
 *         if fields.size() == 0:
 *             raise KeyError(name)             # <<<<<<<<<<<<<<
 *         elif fields.size() > 1:
 *             warnings.warn("Struct field name corresponds to more "
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 255, __pyx_L1_error)
    __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, 255, __pyx_L1_error)

    /* "pyarrow/types.pxi":254
 * 
 *         fields = self.struct_type.GetAllFieldsByName(tobytes(name))
 *         if fields.size() == 0:             # <<<<<<<<<<<<<<
 *             raise KeyError(name)
 *         elif fields.size() > 1:
 */
  }

  /* "pyarrow/types.pxi":256
 *         if fields.size() == 0:
 *             raise KeyError(name)
 *         elif fields.size() > 1:             # <<<<<<<<<<<<<<
 *             warnings.warn("Struct field name corresponds to more "
 *                           "than one field", UserWarning)
 */
  __pyx_t_5 = ((__pyx_v_fields.size() > 1) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "pyarrow/types.pxi":257
 *             raise KeyError(name)
 *         elif fields.size() > 1:
 *             warnings.warn("Struct field name corresponds to more "             # <<<<<<<<<<<<<<
 *                           "than one field", UserWarning)
 *             raise KeyError(name)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_warnings); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_warn); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/types.pxi":258
 *         elif fields.size() > 1:
 *             warnings.warn("Struct field name corresponds to more "
 *                           "than one field", UserWarning)             # <<<<<<<<<<<<<<
 *             raise KeyError(name)
 *         else:
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/types.pxi":259
 *             warnings.warn("Struct field name corresponds to more "
 *                           "than one field", UserWarning)
 *             raise KeyError(name)             # <<<<<<<<<<<<<<
 *         else:
 *             return pyarrow_wrap_field(fields[0])
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 259, __pyx_L1_error)
    __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, 259, __pyx_L1_error)

    /* "pyarrow/types.pxi":256
 *         if fields.size() == 0:
 *             raise KeyError(name)
 *         elif fields.size() > 1:             # <<<<<<<<<<<<<<
 *             warnings.warn("Struct field name corresponds to more "
 *                           "than one field", UserWarning)
 */
  }

  /* "pyarrow/types.pxi":261
 *             raise KeyError(name)
 *         else:
 *             return pyarrow_wrap_field(fields[0])             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  /*else*/ {
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_field((__pyx_v_fields[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 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_Field))))) __PYX_ERR(4, 261, __pyx_L1_error)
    __pyx_r = ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/types.pxi":247
 *         return self.child(i)
 * 
 *     cdef Field field_by_name(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Return a child field by its name rather than its index.
 */

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

/* "pyarrow/types.pxi":263
 *             return pyarrow_wrap_field(fields[0])
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Like num_children().
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pyarrow_3lib_10StructType_1__len__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10StructType___len__[] = "\n        Like num_children().\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_10StructType___len__;
#endif
static Py_ssize_t __pyx_pw_7pyarrow_3lib_10StructType_1__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10StructType___len__(((struct __pyx_obj_7pyarrow_3lib_StructType *)__pyx_v_self));

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

static Py_ssize_t __pyx_pf_7pyarrow_3lib_10StructType___len__(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "pyarrow/types.pxi":267
 *         Like num_children().
 *         """
 *         return self.type.num_children()             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_r = __pyx_v_self->__pyx_base.type->num_children();
  goto __pyx_L0;

  /* "pyarrow/types.pxi":263
 *             return pyarrow_wrap_field(fields[0])
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Like num_children().
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pyarrow_3lib_10StructType_4generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/types.pxi":269
 *         return self.type.num_children()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over struct fields, in order.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10StructType_3__iter__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10StructType_2__iter__[] = "\n        Iterate over struct fields, in order.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_10StructType_2__iter__;
#endif
static PyObject *__pyx_pw_7pyarrow_3lib_10StructType_3__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10StructType_2__iter__(((struct __pyx_obj_7pyarrow_3lib_StructType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_10StructType_2__iter__(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct____iter__(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct____iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(4, 269, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_3lib_10StructType_4generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_StructType___iter, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(4, 269, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.StructType.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7pyarrow_3lib_10StructType_4generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(4, 269, __pyx_L1_error)

  /* "pyarrow/types.pxi":273
 *         Iterate over struct fields, in order.
 *         """
 *         for i in range(len(self)):             # <<<<<<<<<<<<<<
 *             yield self[i]
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(4, 273, __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":274
 *         """
 *         for i in range(len(self)):
 *             yield self[i]             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, i):
 */
    __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(4, 274, __pyx_L1_error)
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/types.pxi":269
 *         return self.type.num_children()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over struct fields, in order.
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":276
 *             yield self[i]
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Return the struct field with the given index or name.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10StructType_6__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10StructType_5__getitem__[] = "\n        Return the struct field with the given index or name.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_10StructType_5__getitem__;
#endif
static PyObject *__pyx_pw_7pyarrow_3lib_10StructType_6__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10StructType_5__getitem__(((struct __pyx_obj_7pyarrow_3lib_StructType *)__pyx_v_self), ((PyObject *)__pyx_v_i));

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

static PyObject *__pyx_pf_7pyarrow_3lib_10StructType_5__getitem__(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pyarrow/types.pxi":280
 *         Return the struct field with the given index or name.
 *         """
 *         if isinstance(i, six.string_types):             # <<<<<<<<<<<<<<
 *             return self.field_by_name(i)
 *         elif isinstance(i, six.integer_types):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_six); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_string_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_i, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 280, __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":281
 *         """
 *         if isinstance(i, six.string_types):
 *             return self.field_by_name(i)             # <<<<<<<<<<<<<<
 *         elif isinstance(i, six.integer_types):
 *             return self.child(i)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7pyarrow_3lib_StructType *)__pyx_v_self->__pyx_base.__pyx_vtab)->field_by_name(__pyx_v_self, __pyx_v_i)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":280
 *         Return the struct field with the given index or name.
 *         """
 *         if isinstance(i, six.string_types):             # <<<<<<<<<<<<<<
 *             return self.field_by_name(i)
 *         elif isinstance(i, six.integer_types):
 */
  }

  /* "pyarrow/types.pxi":282
 *         if isinstance(i, six.string_types):
 *             return self.field_by_name(i)
 *         elif isinstance(i, six.integer_types):             # <<<<<<<<<<<<<<
 *             return self.child(i)
 *         else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_six); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 282, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_integer_types); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 282, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = PyObject_IsInstance(__pyx_v_i, __pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(4, 282, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (likely(__pyx_t_3)) {

    /* "pyarrow/types.pxi":283
 *             return self.field_by_name(i)
 *         elif isinstance(i, six.integer_types):
 *             return self.child(i)             # <<<<<<<<<<<<<<
 *         else:
 *             raise TypeError('Expected integer or string index')
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 283, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7pyarrow_3lib_StructType *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.child(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), __pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 283, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":282
 *         if isinstance(i, six.string_types):
 *             return self.field_by_name(i)
 *         elif isinstance(i, six.integer_types):             # <<<<<<<<<<<<<<
 *             return self.child(i)
 *         else:
 */
  }

  /* "pyarrow/types.pxi":285
 *             return self.child(i)
 *         else:
 *             raise TypeError('Expected integer or string index')             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 285, __pyx_L1_error)
    __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, 285, __pyx_L1_error)
  }

  /* "pyarrow/types.pxi":276
 *             yield self[i]
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Return the struct field with the given index or name.
 */

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

/* "pyarrow/types.pxi":287
 *             raise TypeError('Expected integer or string index')
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return struct, (list(self),)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10StructType_8__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10StructType_7__reduce__[] = "StructType.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10StructType_8__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10StructType_7__reduce__(((struct __pyx_obj_7pyarrow_3lib_StructType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_10StructType_7__reduce__(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/types.pxi":288
 * 
 *     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(4, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PySequence_List(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 288, __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":287
 *             raise TypeError('Expected integer or string index')
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return struct, (list(self),)
 * 
 */

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

/* "pyarrow/types.pxi":291
 * 
 *     @property
 *     def num_children(self):             # <<<<<<<<<<<<<<
 *         """
 *         The number of struct fields.
 */

/* 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":295
 *         The number of struct fields.
 *         """
 *         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(4, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":291
 * 
 *     @property
 *     def num_children(self):             # <<<<<<<<<<<<<<
 *         """
 *         The number of struct fields.
 */

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

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

/* "pyarrow/types.pxi":307
 * 
 *     @property
 *     def num_children(self):             # <<<<<<<<<<<<<<
 *         """
 *         The number of union members.
 */

/* 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":311
 *         The number of union members.
 *         """
 *         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(4, 311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":307
 * 
 *     @property
 *     def num_children(self):             # <<<<<<<<<<<<<<
 *         """
 *         The number of union members.
 */

  /* 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":314
 * 
 *     @property
 *     def mode(self):             # <<<<<<<<<<<<<<
 *         """
 *         The mode of the union ("dense" or "sparse").
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9UnionType_4mode_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_9UnionType_4mode_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9UnionType_4mode___get__(((struct __pyx_obj_7pyarrow_3lib_UnionType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_9UnionType_4mode___get__(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self) {
   arrow::UnionType *__pyx_v_type;
  int __pyx_v_mode;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":318
 *         The mode of the union ("dense" or "sparse").
 *         """
 *         cdef CUnionType* type = <CUnionType*> self.sp_type.get()             # <<<<<<<<<<<<<<
 *         cdef int mode = type.mode()
 *         if mode == _UnionMode_DENSE:
 */
  __pyx_v_type = (( arrow::UnionType *)__pyx_v_self->__pyx_base.sp_type.get());

  /* "pyarrow/types.pxi":319
 *         """
 *         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":320
 *         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":321
 *         cdef int mode = type.mode()
 *         if mode == _UnionMode_DENSE:
 *             return 'dense'             # <<<<<<<<<<<<<<
 *         if mode == _UnionMode_SPARSE:
 *             return 'sparse'
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_dense);
    __pyx_r = __pyx_n_u_dense;
    goto __pyx_L0;

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

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

  /* "pyarrow/types.pxi":324
 *         if mode == _UnionMode_SPARSE:
 *             return 'sparse'
 *         assert 0             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    if (unlikely(!0)) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(4, 324, __pyx_L1_error)
    }
  }
  #endif

  /* "pyarrow/types.pxi":314
 * 
 *     @property
 *     def mode(self):             # <<<<<<<<<<<<<<
 *         """
 *         The mode of the union ("dense" or "sparse").
 */

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

/* "pyarrow/types.pxi":327
 * 
 *     @property
 *     def type_codes(self):             # <<<<<<<<<<<<<<
 *         """
 *         The type code to indicate each data type in this union.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9UnionType_10type_codes_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_9UnionType_10type_codes_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9UnionType_10type_codes___get__(((struct __pyx_obj_7pyarrow_3lib_UnionType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_9UnionType_10type_codes___get__(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self) {
   arrow::UnionType *__pyx_v_type;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":331
 *         The type code to indicate each data type in this union.
 *         """
 *         cdef CUnionType* type = <CUnionType*> self.sp_type.get()             # <<<<<<<<<<<<<<
 *         return type.type_codes()
 * 
 */
  __pyx_v_type = (( arrow::UnionType *)__pyx_v_self->__pyx_base.sp_type.get());

  /* "pyarrow/types.pxi":332
 *         """
 *         cdef CUnionType* type = <CUnionType*> self.sp_type.get()
 *         return type.type_codes()             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_vector_to_py_uint8_t(__pyx_v_type->type_codes()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":327
 * 
 *     @property
 *     def type_codes(self):             # <<<<<<<<<<<<<<
 *         """
 *         The type code to indicate each data type in this union.
 */

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

/* "pyarrow/types.pxi":334
 *         return type.type_codes()
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Like num_children()
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pyarrow_3lib_9UnionType_1__len__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9UnionType___len__[] = "\n        Like num_children()\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_9UnionType___len__;
#endif
static Py_ssize_t __pyx_pw_7pyarrow_3lib_9UnionType_1__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9UnionType___len__(((struct __pyx_obj_7pyarrow_3lib_UnionType *)__pyx_v_self));

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

static Py_ssize_t __pyx_pf_7pyarrow_3lib_9UnionType___len__(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "pyarrow/types.pxi":338
 *         Like num_children()
 *         """
 *         return self.type.num_children()             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_r = __pyx_v_self->__pyx_base.type->num_children();
  goto __pyx_L0;

  /* "pyarrow/types.pxi":334
 *         return type.type_codes()
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Like num_children()
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pyarrow_3lib_9UnionType_4generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/types.pxi":340
 *         return self.type.num_children()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over union members, in order.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9UnionType_3__iter__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9UnionType_2__iter__[] = "\n        Iterate over union members, in order.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_9UnionType_2__iter__;
#endif
static PyObject *__pyx_pw_7pyarrow_3lib_9UnionType_3__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9UnionType_2__iter__(((struct __pyx_obj_7pyarrow_3lib_UnionType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_9UnionType_2__iter__(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__ *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_1___iter__(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_1___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(4, 340, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_3lib_9UnionType_4generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_UnionType___iter, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(4, 340, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.UnionType.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7pyarrow_3lib_9UnionType_4generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__ *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(4, 340, __pyx_L1_error)

  /* "pyarrow/types.pxi":344
 *         Iterate over union members, in order.
 *         """
 *         for i in range(len(self)):             # <<<<<<<<<<<<<<
 *             yield self[i]
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(4, 344, __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":345
 *         """
 *         for i in range(len(self)):
 *             yield self[i]             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, i):
 */
    __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 345, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(4, 345, __pyx_L1_error)
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/types.pxi":340
 *         return self.type.num_children()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over union members, in order.
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":347
 *             yield self[i]
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Return a child member by its index.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9UnionType_6__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9UnionType_5__getitem__[] = "\n        Return a child member by its index.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_9UnionType_5__getitem__;
#endif
static PyObject *__pyx_pw_7pyarrow_3lib_9UnionType_6__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9UnionType_5__getitem__(((struct __pyx_obj_7pyarrow_3lib_UnionType *)__pyx_v_self), ((PyObject *)__pyx_v_i));

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

static PyObject *__pyx_pf_7pyarrow_3lib_9UnionType_5__getitem__(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pyarrow/types.pxi":351
 *         Return a child member by its index.
 *         """
 *         return self.child(i)             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 351, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7pyarrow_3lib_UnionType *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.child(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":347
 *             yield self[i]
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Return a child member by its index.
 */

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

/* "pyarrow/types.pxi":353
 *         return self.child(i)
 * 
 *     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":354
 * 
 *     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(4, 354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PySequence_List(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 354, __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":353
 *         return self.child(i)
 * 
 *     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":362
 *     """
 * 
 *     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":363
 * 
 *     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":364
 *     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":362
 *     """
 * 
 *     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":367
 * 
 *     @property
 *     def unit(self):             # <<<<<<<<<<<<<<
 *         """
 *         The timestamp unit ('s', 'ms', 'us' or 'ns').
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13TimestampType_4unit_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_13TimestampType_4unit_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13TimestampType_4unit___get__(((struct __pyx_obj_7pyarrow_3lib_TimestampType *)__pyx_v_self));

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

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

  /* "pyarrow/types.pxi":371
 *         The timestamp unit ('s', 'ms', 'us' or 'ns').
 *         """
 *         return timeunit_to_string(self.ts_type.unit())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_timeunit_to_string(__pyx_v_self->ts_type->unit()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":367
 * 
 *     @property
 *     def unit(self):             # <<<<<<<<<<<<<<
 *         """
 *         The timestamp unit ('s', 'ms', 'us' or 'ns').
 */

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

/* "pyarrow/types.pxi":374
 * 
 *     @property
 *     def tz(self):             # <<<<<<<<<<<<<<
 *         """
 *         The timestamp time zone, if any, or None.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13TimestampType_2tz_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_13TimestampType_2tz_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13TimestampType_2tz___get__(((struct __pyx_obj_7pyarrow_3lib_TimestampType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_13TimestampType_2tz___get__(struct __pyx_obj_7pyarrow_3lib_TimestampType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":378
 *         The timestamp time zone, if any, or None.
 *         """
 *         if self.ts_type.timezone().size() > 0:             # <<<<<<<<<<<<<<
 *             return frombytes(self.ts_type.timezone())
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_self->ts_type->timezone().size() > 0) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/types.pxi":379
 *         """
 *         if self.ts_type.timezone().size() > 0:
 *             return frombytes(self.ts_type.timezone())             # <<<<<<<<<<<<<<
 *         else:
 *             return None
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 379, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->ts_type->timezone()); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 379, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 379, __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":378
 *         The timestamp time zone, if any, or None.
 *         """
 *         if self.ts_type.timezone().size() > 0:             # <<<<<<<<<<<<<<
 *             return frombytes(self.ts_type.timezone())
 *         else:
 */
  }

  /* "pyarrow/types.pxi":381
 *             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":374
 * 
 *     @property
 *     def tz(self):             # <<<<<<<<<<<<<<
 *         """
 *         The timestamp time zone, if any, or None.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.TimestampType.tz.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":383
 *             return None
 * 
 *     def to_pandas_dtype(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the equivalent NumPy / Pandas dtype.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13TimestampType_1to_pandas_dtype(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13TimestampType_to_pandas_dtype[] = "TimestampType.to_pandas_dtype(self)\n\n        Return the equivalent NumPy / Pandas dtype.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_13TimestampType_1to_pandas_dtype(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_pandas_dtype (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13TimestampType_to_pandas_dtype(((struct __pyx_obj_7pyarrow_3lib_TimestampType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_13TimestampType_to_pandas_dtype(struct __pyx_obj_7pyarrow_3lib_TimestampType *__pyx_v_self) {
  PyObject *__pyx_v_make_datetimetz = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("to_pandas_dtype", 0);

  /* "pyarrow/types.pxi":387
 *         Return the equivalent NumPy / Pandas dtype.
 *         """
 *         if self.tz is None:             # <<<<<<<<<<<<<<
 *             return _pandas_type_map[_Type_TIMESTAMP]
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tz); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 387, __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":388
 *         """
 *         if self.tz is None:
 *             return _pandas_type_map[_Type_TIMESTAMP]             # <<<<<<<<<<<<<<
 *         else:
 *             # Return DatetimeTZ
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(__pyx_v_7pyarrow_3lib__pandas_type_map == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(4, 388, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIMESTAMP); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_7pyarrow_3lib__pandas_type_map, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 388, __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":387
 *         Return the equivalent NumPy / Pandas dtype.
 *         """
 *         if self.tz is None:             # <<<<<<<<<<<<<<
 *             return _pandas_type_map[_Type_TIMESTAMP]
 *         else:
 */
  }

  /* "pyarrow/types.pxi":391
 *         else:
 *             # Return DatetimeTZ
 *             from pyarrow.pandas_compat import make_datetimetz             # <<<<<<<<<<<<<<
 *             return make_datetimetz(self.tz)
 * 
 */
  /*else*/ {
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 391, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_n_s_make_datetimetz);
    __Pyx_GIVEREF(__pyx_n_s_make_datetimetz);
    PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_make_datetimetz);
    __pyx_t_1 = __Pyx_Import(__pyx_n_s_pyarrow_pandas_compat, __pyx_t_4, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 391, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_make_datetimetz); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 391, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_make_datetimetz = __pyx_t_4;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/types.pxi":392
 *             # Return DatetimeTZ
 *             from pyarrow.pandas_compat import make_datetimetz
 *             return make_datetimetz(self.tz)             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tz); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 392, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_make_datetimetz);
    __pyx_t_5 = __pyx_v_make_datetimetz; __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 392, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/types.pxi":383
 *             return None
 * 
 *     def to_pandas_dtype(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the equivalent NumPy / Pandas dtype.
 */

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

/* "pyarrow/types.pxi":394
 *             return make_datetimetz(self.tz)
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return timestamp, (self.unit, self.tz)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13TimestampType_3__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13TimestampType_2__reduce__[] = "TimestampType.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_13TimestampType_3__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13TimestampType_2__reduce__(((struct __pyx_obj_7pyarrow_3lib_TimestampType *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_13TimestampType_2__reduce__(struct __pyx_obj_7pyarrow_3lib_TimestampType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/types.pxi":395
 * 
 *     def __reduce__(self):
 *         return timestamp, (self.unit, self.tz)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_timestamp); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unit); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tz); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 395, __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":394
 *             return make_datetimetz(self.tz)
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return timestamp, (self.unit, self.tz)
 * 
 */

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

/* "pyarrow/types.pxi":403
 *     """
 * 
 *     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":404
 * 
 *     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":405
 *     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":403
 *     """
 * 
 *     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":408
 * 
 *     @property
 *     def unit(self):             # <<<<<<<<<<<<<<
 *         """
 *         The time unit ('s', 'ms', 'us' or 'ns').
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Time32Type_4unit_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_10Time32Type_4unit_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Time32Type_4unit___get__(((struct __pyx_obj_7pyarrow_3lib_Time32Type *)__pyx_v_self));

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

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

  /* "pyarrow/types.pxi":412
 *         The time unit ('s', 'ms', 'us' or 'ns').
 *         """
 *         return timeunit_to_string(self.time_type.unit())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_timeunit_to_string(__pyx_v_self->time_type->unit()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":408
 * 
 *     @property
 *     def unit(self):             # <<<<<<<<<<<<<<
 *         """
 *         The time unit ('s', 'ms', 'us' or 'ns').
 */

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

/* "pyarrow/types.pxi":420
 *     """
 * 
 *     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":421
 * 
 *     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":422
 *     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":420
 *     """
 * 
 *     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":425
 * 
 *     @property
 *     def unit(self):             # <<<<<<<<<<<<<<
 *         """
 *         The time unit ('s', 'ms', 'us' or 'ns').
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Time64Type_4unit_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_10Time64Type_4unit_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Time64Type_4unit___get__(((struct __pyx_obj_7pyarrow_3lib_Time64Type *)__pyx_v_self));

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

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

  /* "pyarrow/types.pxi":429
 *         The time unit ('s', 'ms', 'us' or 'ns').
 *         """
 *         return timeunit_to_string(self.time_type.unit())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_timeunit_to_string(__pyx_v_self->time_type->unit()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":425
 * 
 *     @property
 *     def unit(self):             # <<<<<<<<<<<<<<
 *         """
 *         The time unit ('s', 'ms', 'us' or 'ns').
 */

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

/* "pyarrow/types.pxi":437
 *     """
 * 
 *     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":438
 * 
 *     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":439
 *     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":437
 *     """
 * 
 *     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":442
 *             <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":443
 * 
 *     def __reduce__(self):
 *         return binary, (self.byte_width,)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_binary); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_byte_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 443, __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":442
 *             <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":446
 * 
 *     @property
 *     def byte_width(self):             # <<<<<<<<<<<<<<
 *         """
 *         The binary size in bytes.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19FixedSizeBinaryType_10byte_width_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_19FixedSizeBinaryType_10byte_width_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19FixedSizeBinaryType_10byte_width___get__(((struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType *)__pyx_v_self));

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

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

  /* "pyarrow/types.pxi":450
 *         The binary size in bytes.
 *         """
 *         return self.fixed_size_binary_type.byte_width()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->fixed_size_binary_type->byte_width()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":446
 * 
 *     @property
 *     def byte_width(self):             # <<<<<<<<<<<<<<
 *         """
 *         The binary size in bytes.
 */

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

/* "pyarrow/types.pxi":458
 *     """
 * 
 *     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":459
 * 
 *     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":460
 *     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":458
 *     """
 * 
 *     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":462
 *         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":463
 * 
 *     def __reduce__(self):
 *         return decimal128, (self.precision, self.scale)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_decimal128); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_precision); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_scale); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 463, __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":462
 *         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":466
 * 
 *     @property
 *     def precision(self):             # <<<<<<<<<<<<<<
 *         """
 *         The decimal precision, in number of decimal digits (an integer).
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14Decimal128Type_9precision_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14Decimal128Type_9precision_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14Decimal128Type_9precision___get__(((struct __pyx_obj_7pyarrow_3lib_Decimal128Type *)__pyx_v_self));

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

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

  /* "pyarrow/types.pxi":470
 *         The decimal precision, in number of decimal digits (an integer).
 *         """
 *         return self.decimal128_type.precision()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->decimal128_type->precision()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":466
 * 
 *     @property
 *     def precision(self):             # <<<<<<<<<<<<<<
 *         """
 *         The decimal precision, in number of decimal digits (an integer).
 */

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

/* "pyarrow/types.pxi":473
 * 
 *     @property
 *     def scale(self):             # <<<<<<<<<<<<<<
 *         """
 *         The decimal scale (an integer).
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14Decimal128Type_5scale_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14Decimal128Type_5scale_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14Decimal128Type_5scale___get__(((struct __pyx_obj_7pyarrow_3lib_Decimal128Type *)__pyx_v_self));

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

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

  /* "pyarrow/types.pxi":477
 *         The decimal scale (an integer).
 *         """
 *         return self.decimal128_type.scale()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->decimal128_type->scale()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":473
 * 
 *     @property
 *     def scale(self):             # <<<<<<<<<<<<<<
 *         """
 *         The decimal scale (an integer).
 */

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

/* "pyarrow/types.pxi":488
 *     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":491
 *         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":492
 * 
 *     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__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 492, __pyx_L1_error)
  __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, 492, __pyx_L1_error)

  /* "pyarrow/types.pxi":491
 *         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":495
 *                         "`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":496
 * 
 *     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":497
 *     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":498
 *         self.sp_field = field
 *         self.field = field.get()
 *         self.type = pyarrow_wrap_data_type(field.get().type())             # <<<<<<<<<<<<<<
 * 
 *     def equals(self, Field other):
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_field.get()->type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(4, 498, __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":495
 *                         "`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":500
 *         self.type = pyarrow_wrap_data_type(field.get().type())
 * 
 *     def equals(self, Field other):             # <<<<<<<<<<<<<<
 *         """
 *         Test if this field is equal to the other
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_5equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Field_4equals[] = "Field.equals(self, Field other)\n\n        Test if this field is equal to the other\n\n        Parameters\n        ----------\n        other : pyarrow.Field\n\n        Returns\n        -------\n        is_equal : boolean\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_5equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equals (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_7pyarrow_3lib_Field, 1, "other", 0))) __PYX_ERR(4, 500, __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":512
 *         is_equal : boolean
 *         """
 *         return self.field.Equals(deref(other.field))             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->field->Equals((*__pyx_v_other->field))); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":500
 *         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":514
 *         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":515
 * 
 *     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":516
 *     def __eq__(self, other):
 *         try:
 *             return self.equals(other)             # <<<<<<<<<<<<<<
 *         except TypeError:
 *             return NotImplemented
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_equals); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 516, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_other);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 516, __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":515
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/types.pxi":517
 *         try:
 *             return self.equals(other)
 *         except TypeError:             # <<<<<<<<<<<<<<
 *             return NotImplemented
 * 
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pyarrow.lib.Field.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(4, 517, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "pyarrow/types.pxi":518
 *             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":515
 * 
 *     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":514
 *         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":520
 *             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":521
 * 
 *     def __reduce__(self):
 *         return field, (self.name, self.type, self.nullable, self.metadata)             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_field); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 521, __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(4, 521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_nullable); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_metadata); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->type));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->type));
  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_self->type));
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 521, __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":520
 *             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":523
 *         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":524
 * 
 *     def __str__(self):
 *         return 'pyarrow.Field<{0}>'.format(frombytes(self.field.ToString()))             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_pyarrow_Field_0, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->field->ToString()); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 524, __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":523
 *         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":526
 *         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":527
 * 
 *     def __repr__(self):
 *         return self.__str__()             # <<<<<<<<<<<<<<
 * 
 *     def __hash__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 527, __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, 527, __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":526
 *         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":529
 *         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":530
 * 
 *     def __hash__(self):
 *         return hash((self.field.name(), self.type, self.field.nullable()))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->field->name()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->field->nullable()); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->type));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->type));
  PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self->type));
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_4 = PyObject_Hash(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_hash_t)-1))) __PYX_ERR(4, 530, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":529
 *         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":533
 * 
 *     @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":534
 *     @property
 *     def nullable(self):
 *         return self.field.nullable()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->field->nullable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":533
 * 
 *     @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":537
 * 
 *     @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":538
 *     @property
 *     def name(self):
 *         return frombytes(self.field.name())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->field->name()); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 538, __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":537
 * 
 *     @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":541
 * 
 *     @property
 *     def metadata(self):             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_metadata(self.field.metadata())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_8metadata_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_8metadata_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Field_8metadata___get__(((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_self));

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

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

  /* "pyarrow/types.pxi":542
 *     @property
 *     def metadata(self):
 *         return pyarrow_wrap_metadata(self.field.metadata())             # <<<<<<<<<<<<<<
 * 
 *     def add_metadata(self, metadata):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_metadata(__pyx_v_self->field->metadata()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":541
 * 
 *     @property
 *     def metadata(self):             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_metadata(self.field.metadata())
 * 
 */

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

/* "pyarrow/types.pxi":544
 *         return pyarrow_wrap_metadata(self.field.metadata())
 * 
 *     def add_metadata(self, 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, 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);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Field_16add_metadata(((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_self), ((PyObject *)__pyx_v_metadata));

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

static PyObject *__pyx_pf_7pyarrow_3lib_5Field_16add_metadata(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self, PyObject *__pyx_v_metadata) {
  std::shared_ptr< arrow::Field>  __pyx_v_c_field;
  std::shared_ptr< arrow::KeyValueMetadata>  __pyx_v_c_meta;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("add_metadata", 0);

  /* "pyarrow/types.pxi":561
 *             shared_ptr[CKeyValueMetadata] c_meta
 * 
 *         if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *             raise TypeError('Metadata must be an instance of dict')
 * 
 */
  __pyx_t_1 = PyDict_Check(__pyx_v_metadata); 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/types.pxi":562
 * 
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')             # <<<<<<<<<<<<<<
 * 
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 562, __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, 562, __pyx_L1_error)

    /* "pyarrow/types.pxi":561
 *             shared_ptr[CKeyValueMetadata] c_meta
 * 
 *         if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *             raise TypeError('Metadata must be an instance of dict')
 * 
 */
  }

  /* "pyarrow/types.pxi":564
 *             raise TypeError('Metadata must be an instance of dict')
 * 
 *         c_meta = pyarrow_unwrap_metadata(metadata)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             c_field = self.field.AddMetadata(c_meta)
 */
  __pyx_v_c_meta = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_metadata(__pyx_v_metadata);

  /* "pyarrow/types.pxi":565
 * 
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_field = self.field.AddMetadata(c_meta)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/types.pxi":566
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 *         with nogil:
 *             c_field = self.field.AddMetadata(c_meta)             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_field(c_field)
 */
        __pyx_v_c_field = __pyx_v_self->field->AddMetadata(__pyx_v_c_meta);
      }

      /* "pyarrow/types.pxi":565
 * 
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_field = self.field.AddMetadata(c_meta)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L6;
        }
        __pyx_L6:;
      }
  }

  /* "pyarrow/types.pxi":568
 *             c_field = self.field.AddMetadata(c_meta)
 * 
 *         return pyarrow_wrap_field(c_field)             # <<<<<<<<<<<<<<
 * 
 *     def remove_metadata(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_field(__pyx_v_c_field); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Field.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":570
 *         return pyarrow_wrap_field(c_field)
 * 
 *     def remove_metadata(self):             # <<<<<<<<<<<<<<
 *         """
 *         Create new field without metadata, if any
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_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":579
 *         """
 *         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":580
 *         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":579
 *         """
 *         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":581
 *         with nogil:
 *             new_field = self.field.RemoveMetadata()
 *         return pyarrow_wrap_field(new_field)             # <<<<<<<<<<<<<<
 * 
 *     def flatten(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_field(__pyx_v_new_field); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":570
 *         return pyarrow_wrap_field(c_field)
 * 
 *     def remove_metadata(self):             # <<<<<<<<<<<<<<
 *         """
 *         Create new field without metadata, if any
 */

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

/* "pyarrow/types.pxi":583
 *         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_7genexpr__pyx_v_f;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::vector<std::shared_ptr< arrow::Field> > ::iterator __pyx_t_2;
  std::shared_ptr< arrow::Field>  __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("flatten", 0);

  /* "pyarrow/types.pxi":593
 *         """
 *         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":594
 *         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":593
 *         """
 *         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":595
 *         with nogil:
 *             flattened = self.field.Flatten()
 *         return [pyarrow_wrap_field(f) for f in flattened]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 595, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_v_flattened.begin();
    for (;;) {
      if (!(__pyx_t_2 != __pyx_v_flattened.end())) break;
      __pyx_t_3 = *__pyx_t_2;
      ++__pyx_t_2;
      __pyx_7genexpr__pyx_v_f = __pyx_t_3;
      __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_field(__pyx_7genexpr__pyx_v_f); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 595, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(4, 595, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":583
 *         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":108
 * 
 *     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":600
 * 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":603
 *         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":604
 * 
 *     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__15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 604, __pyx_L1_error)
  __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, 604, __pyx_L1_error)

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

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

/* "pyarrow/types.pxi":610
 *         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":611
 * 
 *     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(4, 611, __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(4, 611, __pyx_L1_error)
  __pyx_v_index = ((int)__pyx_t_2);

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

  /* "pyarrow/types.pxi":610
 *         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":614
 *         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(4, 614, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_3lib_6Schema_10generator2, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_Schema___iter, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(4, 614, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.Schema.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7pyarrow_3lib_6Schema_10generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__ *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(4, 614, __pyx_L1_error)

  /* "pyarrow/types.pxi":615
 * 
 *     def __iter__(self):
 *         for i in range(len(self)):             # <<<<<<<<<<<<<<
 *             yield self[i]
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(4, 615, __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":616
 *     def __iter__(self):
 *         for i in range(len(self)):
 *             yield self[i]             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const vector[shared_ptr[CField]]& fields):
 */
    __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 616, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(4, 616, __pyx_L1_error)
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/types.pxi":614
 *         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":618
 *             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":619
 * 
 *     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":620
 *     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":618
 *             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":622
 *         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":623
 * 
 *     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":624
 *     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":622
 *         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":626
 *         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":627
 * 
 *     def __reduce__(self):
 *         return schema, (list(self), self.metadata)             # <<<<<<<<<<<<<<
 * 
 *     def __hash__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_schema); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PySequence_List(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_metadata); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 627, __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":626
 *         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":629
 *         return schema, (list(self), self.metadata)
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash((tuple(self), self.metadata))
 * 
 */

/* Python wrapper */
static Py_hash_t __pyx_pw_7pyarrow_3lib_6Schema_14__hash__(PyObject *__pyx_v_self); /*proto*/
static Py_hash_t __pyx_pw_7pyarrow_3lib_6Schema_14__hash__(PyObject *__pyx_v_self) {
  Py_hash_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_13__hash__(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self));

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

static Py_hash_t __pyx_pf_7pyarrow_3lib_6Schema_13__hash__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self) {
  Py_hash_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_hash_t __pyx_t_4;
  __Pyx_RefNannySetupContext("__hash__", 0);

  /* "pyarrow/types.pxi":630
 * 
 *     def __hash__(self):
 *         return hash((tuple(self), self.metadata))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_1 = PySequence_Tuple(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_metadata); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_4 = PyObject_Hash(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_hash_t)-1))) __PYX_ERR(4, 630, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":629
 *         return schema, (list(self), self.metadata)
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash((tuple(self), self.metadata))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Schema.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":633
 * 
 *     @property
 *     def pandas_metadata(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return deserialized-from-JSON pandas metadata field (if it exists)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_15pandas_metadata_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_15pandas_metadata_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_15pandas_metadata___get__(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_15pandas_metadata___get__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self) {
  PyObject *__pyx_v_metadata = NULL;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_json = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":637
 *         Return deserialized-from-JSON pandas metadata field (if it exists)
 *         """
 *         metadata = self.metadata             # <<<<<<<<<<<<<<
 *         key = b'pandas'
 *         if metadata is None or key not in metadata:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_metadata); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 637, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_metadata = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":638
 *         """
 *         metadata = self.metadata
 *         key = b'pandas'             # <<<<<<<<<<<<<<
 *         if metadata is None or key not in metadata:
 *             return None
 */
  __Pyx_INCREF(__pyx_n_b_pandas);
  __pyx_v_key = __pyx_n_b_pandas;

  /* "pyarrow/types.pxi":639
 *         metadata = self.metadata
 *         key = b'pandas'
 *         if metadata is None or key not in metadata:             # <<<<<<<<<<<<<<
 *             return None
 * 
 */
  __pyx_t_3 = (__pyx_v_metadata == Py_None);
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, __pyx_v_metadata, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(4, 639, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pyarrow/types.pxi":640
 *         key = b'pandas'
 *         if metadata is None or key not in metadata:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *         import json
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/types.pxi":639
 *         metadata = self.metadata
 *         key = b'pandas'
 *         if metadata is None or key not in metadata:             # <<<<<<<<<<<<<<
 *             return None
 * 
 */
  }

  /* "pyarrow/types.pxi":642
 *             return None
 * 
 *         import json             # <<<<<<<<<<<<<<
 *         return json.loads(metadata[key].decode('utf8'))
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_json, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_json = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":643
 * 
 *         import json
 *         return json.loads(metadata[key].decode('utf8'))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_json, __pyx_n_s_loads); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_metadata, __pyx_v_key); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_decode); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_n_u_utf8) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_n_u_utf8);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":633
 * 
 *     @property
 *     def pandas_metadata(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return deserialized-from-JSON pandas metadata field (if it exists)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.Schema.pandas_metadata.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_metadata);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_json);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":646
 * 
 *     @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":655
 *         """
 *         cdef int i
 *         result = []             # <<<<<<<<<<<<<<
 *         for i in range(self.schema.num_fields()):
 *             name = frombytes(self.schema.field(i).get().name())
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 655, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":656
 *         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":657
 *         result = []
 *         for i in range(self.schema.num_fields()):
 *             name = frombytes(self.schema.field(i).get().name())             # <<<<<<<<<<<<<<
 *             result.append(name)
 *         return result
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 657, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->schema->field(__pyx_v_i).get()->name()); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 657, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 657, __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":658
 *         for i in range(self.schema.num_fields()):
 *             name = frombytes(self.schema.field(i).get().name())
 *             result.append(name)             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_name); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(4, 658, __pyx_L1_error)
  }

  /* "pyarrow/types.pxi":659
 *             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":646
 * 
 *     @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":662
 * 
 *     @property
 *     def types(self):             # <<<<<<<<<<<<<<
 *         """
 *         The schema's field types.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_5types_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_5types_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_5types___get__(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_5types___get__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self) {
  PyObject *__pyx_8genexpr1__pyx_v_field = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":670
 *         list of DataType
 *         """
 *         return [field.type for field in self]             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 670, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (likely(PyList_CheckExact(((PyObject *)__pyx_v_self))) || PyTuple_CheckExact(((PyObject *)__pyx_v_self))) {
      __pyx_t_2 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
      __pyx_t_4 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 670, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 670, __pyx_L5_error)
    }
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(4, 670, __pyx_L5_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 670, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(4, 670, __pyx_L5_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 670, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_4(__pyx_t_2);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(4, 670, __pyx_L5_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_field, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr1__pyx_v_field, __pyx_n_s_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 670, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(4, 670, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_field); __pyx_8genexpr1__pyx_v_field = 0;
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_field); __pyx_8genexpr1__pyx_v_field = 0;
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":662
 * 
 *     @property
 *     def types(self):             # <<<<<<<<<<<<<<
 *         """
 *         The schema's field types.
 */

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

/* "pyarrow/types.pxi":673
 * 
 *     @property
 *     def metadata(self):             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_metadata(self.schema.metadata())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_8metadata_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_8metadata_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_8metadata___get__(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self));

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

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

  /* "pyarrow/types.pxi":674
 *     @property
 *     def metadata(self):
 *         return pyarrow_wrap_metadata(self.schema.metadata())             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_metadata(__pyx_v_self->schema->metadata()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":673
 * 
 *     @property
 *     def metadata(self):             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_metadata(self.schema.metadata())
 * 
 */

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

/* "pyarrow/types.pxi":676
 *         return pyarrow_wrap_metadata(self.schema.metadata())
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         try:
 *             return self.equals(other)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_16__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_16__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_15__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_15__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":677
 * 
 *     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":678
 *     def __eq__(self, other):
 *         try:
 *             return self.equals(other)             # <<<<<<<<<<<<<<
 *         except TypeError:
 *             return NotImplemented
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_equals); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 678, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_other);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 678, __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":677
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/types.pxi":679
 *         try:
 *             return self.equals(other)
 *         except TypeError:             # <<<<<<<<<<<<<<
 *             return NotImplemented
 * 
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pyarrow.lib.Schema.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(4, 679, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "pyarrow/types.pxi":680
 *             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":677
 * 
 *     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":676
 *         return pyarrow_wrap_metadata(self.schema.metadata())
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         try:
 *             return self.equals(other)
 */

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

/* "pyarrow/types.pxi":682
 *             return NotImplemented
 * 
 *     def empty_table(self):             # <<<<<<<<<<<<<<
 *         """
 *         Provide an empty table according to the schema.
 */

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

  /* "pyarrow/types.pxi":691
 *         """
 *         arrays = []
 *         names = []             # <<<<<<<<<<<<<<
 *         for field in self:
 *             arrays.append(array([], type=field.type))
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_names = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":692
 *         arrays = []
 *         names = []
 *         for field in self:             # <<<<<<<<<<<<<<
 *             arrays.append(array([], type=field.type))
 *             names.append(field.name)
 */
  if (likely(PyList_CheckExact(((PyObject *)__pyx_v_self))) || PyTuple_CheckExact(((PyObject *)__pyx_v_self))) {
    __pyx_t_1 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 692, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 692, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(4, 692, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 692, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(4, 692, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 692, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(4, 692, __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":693
 *         names = []
 *         for field in self:
 *             arrays.append(array([], type=field.type))             # <<<<<<<<<<<<<<
 *             names.append(field.name)
 *         return Table.from_arrays(
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_field, __pyx_n_s_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_type, __pyx_t_7) < 0) __PYX_ERR(4, 693, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_arrays, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(4, 693, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "pyarrow/types.pxi":694
 *         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(4, 694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_names, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(4, 694, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "pyarrow/types.pxi":692
 *         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":695
 *             arrays.append(array([], type=field.type))
 *             names.append(field.name)
 *         return Table.from_arrays(             # <<<<<<<<<<<<<<
 *             arrays=arrays,
 *             names=names,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Table), __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/types.pxi":696
 *             names.append(field.name)
 *         return Table.from_arrays(
 *             arrays=arrays,             # <<<<<<<<<<<<<<
 *             names=names,
 *             metadata=self.metadata
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_arrays, __pyx_v_arrays) < 0) __PYX_ERR(4, 696, __pyx_L1_error)

  /* "pyarrow/types.pxi":697
 *         return Table.from_arrays(
 *             arrays=arrays,
 *             names=names,             # <<<<<<<<<<<<<<
 *             metadata=self.metadata
 *         )
 */
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_names, __pyx_v_names) < 0) __PYX_ERR(4, 696, __pyx_L1_error)

  /* "pyarrow/types.pxi":698
 *             arrays=arrays,
 *             names=names,
 *             metadata=self.metadata             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_metadata); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_metadata, __pyx_t_5) < 0) __PYX_ERR(4, 696, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":695
 *             arrays.append(array([], type=field.type))
 *             names.append(field.name)
 *         return Table.from_arrays(             # <<<<<<<<<<<<<<
 *             arrays=arrays,
 *             names=names,
 */
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 695, __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":682
 *             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":701
 *         )
 * 
 *     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_20equals(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_19equals[] = "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_20equals(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(4, 701, __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(4, 701, __pyx_L3_error)
    } else {
      __pyx_v_check_metadata = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("equals", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 701, __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_19equals(((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_19equals(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":715
 *         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(4, 715, __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":716
 *         """
 *         cdef Schema _other = other
 *         return self.sp_schema.get().Equals(deref(_other.schema),             # <<<<<<<<<<<<<<
 *                                            check_metadata)
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/types.pxi":717
 *         cdef Schema _other = other
 *         return self.sp_schema.get().Equals(deref(_other.schema),
 *                                            check_metadata)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->sp_schema.get()->Equals((*__pyx_v__other->schema), __pyx_v_check_metadata)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":701
 *         )
 * 
 *     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":720
 * 
 *     @classmethod
 *     def from_pandas(cls, df, bint preserve_index=True):             # <<<<<<<<<<<<<<
 *         """
 *         Returns implied schema from dataframe
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_22from_pandas(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_21from_pandas[] = "Schema.from_pandas(type cls, df, bool preserve_index=True)\n\n        Returns implied schema from dataframe\n\n        Parameters\n        ----------\n        df : pandas.DataFrame\n        preserve_index : bool, default True\n            Whether to store the index as an additional column (or columns, for\n            MultiIndex) in the resulting `Table`.\n\n        Returns\n        -------\n        pyarrow.Schema\n\n        Examples\n        --------\n\n        >>> import pandas as pd\n        >>> import pyarrow as pa\n        >>> df = pd.DataFrame({\n            ...     'int': [1, 2],\n            ...     'str': ['a', 'b']\n            ... })\n        >>> pa.Schema.from_pandas(df)\n        int: int64\n        str: string\n        __index_level_0__: int64\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_22from_pandas(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_df = 0;
  int __pyx_v_preserve_index;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_pandas (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_df,&__pyx_n_s_preserve_index,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_df)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_preserve_index);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_pandas") < 0)) __PYX_ERR(4, 720, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_df = values[0];
    if (values[1]) {
      __pyx_v_preserve_index = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_preserve_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 720, __pyx_L3_error)
    } else {
      __pyx_v_preserve_index = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_pandas", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 720, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Schema.from_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_21from_pandas(((PyTypeObject*)__pyx_v_cls), __pyx_v_df, __pyx_v_preserve_index);

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_21from_pandas(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_df, int __pyx_v_preserve_index) {
  PyObject *__pyx_v_dataframe_to_types = NULL;
  PyObject *__pyx_v_names = NULL;
  PyObject *__pyx_v_types = NULL;
  PyObject *__pyx_v_metadata = NULL;
  PyObject *__pyx_v_fields = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_type_ = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("from_pandas", 0);

  /* "pyarrow/types.pxi":749
 *         __index_level_0__: int64
 *         """
 *         from pyarrow.pandas_compat import dataframe_to_types             # <<<<<<<<<<<<<<
 *         names, types, metadata = dataframe_to_types(
 *             df,
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 749, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_dataframe_to_types);
  __Pyx_GIVEREF(__pyx_n_s_dataframe_to_types);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_dataframe_to_types);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_pyarrow_pandas_compat, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 749, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_dataframe_to_types); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 749, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_dataframe_to_types = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":750
 *         """
 *         from pyarrow.pandas_compat import dataframe_to_types
 *         names, types, metadata = dataframe_to_types(             # <<<<<<<<<<<<<<
 *             df,
 *             preserve_index=preserve_index
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_df);
  __Pyx_GIVEREF(__pyx_v_df);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_df);

  /* "pyarrow/types.pxi":752
 *         names, types, metadata = dataframe_to_types(
 *             df,
 *             preserve_index=preserve_index             # <<<<<<<<<<<<<<
 *         )
 *         fields = []
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_preserve_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_preserve_index, __pyx_t_3) < 0) __PYX_ERR(4, 752, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/types.pxi":750
 *         """
 *         from pyarrow.pandas_compat import dataframe_to_types
 *         names, types, metadata = dataframe_to_types(             # <<<<<<<<<<<<<<
 *             df,
 *             preserve_index=preserve_index
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_dataframe_to_types, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(4, 750, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_4);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 750, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 750, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 750, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 750, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(4, 750, __pyx_L1_error)
    __pyx_t_6 = NULL;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(4, 750, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_names = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_types = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_metadata = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyarrow/types.pxi":754
 *             preserve_index=preserve_index
 *         )
 *         fields = []             # <<<<<<<<<<<<<<
 *         for name, type_ in zip(names, types):
 *             fields.append(field(name, type_))
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_fields = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyarrow/types.pxi":755
 *         )
 *         fields = []
 *         for name, type_ in zip(names, types):             # <<<<<<<<<<<<<<
 *             fields.append(field(name, type_))
 *         return schema(fields, metadata)
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_names);
  __Pyx_GIVEREF(__pyx_v_names);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_names);
  __Pyx_INCREF(__pyx_v_types);
  __Pyx_GIVEREF(__pyx_v_types);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_types);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 755, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 755, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(4, 755, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 755, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(4, 755, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 755, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_8(__pyx_t_3);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(4, 755, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
      PyObject* sequence = __pyx_t_4;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(4, 755, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      #else
      __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 755, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 755, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #endif
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 755, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
      index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      index = 1; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(4, 755, __pyx_L1_error)
      __pyx_t_6 = NULL;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L8_unpacking_done;
      __pyx_L7_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(4, 755, __pyx_L1_error)
      __pyx_L8_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_type_, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/types.pxi":756
 *         fields = []
 *         for name, type_ in zip(names, types):
 *             fields.append(field(name, type_))             # <<<<<<<<<<<<<<
 *         return schema(fields, metadata)
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_field); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 756, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_9 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_name, __pyx_v_type_};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 756, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_name, __pyx_v_type_};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 756, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 756, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__pyx_t_2) {
        __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
      }
      __Pyx_INCREF(__pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_9, __pyx_v_name);
      __Pyx_INCREF(__pyx_v_type_);
      __Pyx_GIVEREF(__pyx_v_type_);
      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_9, __pyx_v_type_);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 756, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_fields, __pyx_t_4); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(4, 756, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/types.pxi":755
 *         )
 *         fields = []
 *         for name, type_ in zip(names, types):             # <<<<<<<<<<<<<<
 *             fields.append(field(name, type_))
 *         return schema(fields, metadata)
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/types.pxi":757
 *         for name, type_ in zip(names, types):
 *             fields.append(field(name, type_))
 *         return schema(fields, metadata)             # <<<<<<<<<<<<<<
 * 
 *     def field_by_name(self, name):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_schema); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_fields, __pyx_v_metadata};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 757, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_fields, __pyx_v_metadata};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 757, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 757, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_1) {
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL;
    }
    __Pyx_INCREF(__pyx_v_fields);
    __Pyx_GIVEREF(__pyx_v_fields);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_9, __pyx_v_fields);
    __Pyx_INCREF(__pyx_v_metadata);
    __Pyx_GIVEREF(__pyx_v_metadata);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_9, __pyx_v_metadata);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 757, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":720
 * 
 *     @classmethod
 *     def from_pandas(cls, df, bint preserve_index=True):             # <<<<<<<<<<<<<<
 *         """
 *         Returns implied schema from dataframe
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.Schema.from_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dataframe_to_types);
  __Pyx_XDECREF(__pyx_v_names);
  __Pyx_XDECREF(__pyx_v_types);
  __Pyx_XDECREF(__pyx_v_metadata);
  __Pyx_XDECREF(__pyx_v_fields);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_type_);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":759
 *         return schema(fields, 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_24field_by_name(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_23field_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_24field_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_23field_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_23field_by_name(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_name) {
  std::vector<std::shared_ptr< arrow::Field> >  __pyx_v_results;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("field_by_name", 0);

  /* "pyarrow/types.pxi":774
 *             vector[shared_ptr[CField]] results
 * 
 *         results = self.schema.GetAllFieldsByName(tobytes(name))             # <<<<<<<<<<<<<<
 *         if results.size() == 0:
 *             return None
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_name);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 774, __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, 774, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_results = __pyx_v_self->schema->GetAllFieldsByName(__pyx_t_4);

  /* "pyarrow/types.pxi":775
 * 
 *         results = self.schema.GetAllFieldsByName(tobytes(name))
 *         if results.size() == 0:             # <<<<<<<<<<<<<<
 *             return None
 *         elif results.size() > 1:
 */
  __pyx_t_5 = ((__pyx_v_results.size() == 0) != 0);
  if (__pyx_t_5) {

    /* "pyarrow/types.pxi":776
 *         results = self.schema.GetAllFieldsByName(tobytes(name))
 *         if results.size() == 0:
 *             return None             # <<<<<<<<<<<<<<
 *         elif results.size() > 1:
 *             warnings.warn("Schema field name corresponds to more "
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/types.pxi":775
 * 
 *         results = self.schema.GetAllFieldsByName(tobytes(name))
 *         if results.size() == 0:             # <<<<<<<<<<<<<<
 *             return None
 *         elif results.size() > 1:
 */
  }

  /* "pyarrow/types.pxi":777
 *         if results.size() == 0:
 *             return None
 *         elif results.size() > 1:             # <<<<<<<<<<<<<<
 *             warnings.warn("Schema field name corresponds to more "
 *                           "than one field", UserWarning)
 */
  __pyx_t_5 = ((__pyx_v_results.size() > 1) != 0);
  if (__pyx_t_5) {

    /* "pyarrow/types.pxi":778
 *             return None
 *         elif results.size() > 1:
 *             warnings.warn("Schema field name corresponds to more "             # <<<<<<<<<<<<<<
 *                           "than one field", UserWarning)
 *             return None
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_warnings); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 778, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_warn); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 778, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/types.pxi":779
 *         elif results.size() > 1:
 *             warnings.warn("Schema field name corresponds to more "
 *                           "than one field", UserWarning)             # <<<<<<<<<<<<<<
 *             return None
 *         else:
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 778, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/types.pxi":780
 *             warnings.warn("Schema field name corresponds to more "
 *                           "than one field", UserWarning)
 *             return None             # <<<<<<<<<<<<<<
 *         else:
 *             return pyarrow_wrap_field(results[0])
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/types.pxi":777
 *         if results.size() == 0:
 *             return None
 *         elif results.size() > 1:             # <<<<<<<<<<<<<<
 *             warnings.warn("Schema field name corresponds to more "
 *                           "than one field", UserWarning)
 */
  }

  /* "pyarrow/types.pxi":782
 *             return None
 *         else:
 *             return pyarrow_wrap_field(results[0])             # <<<<<<<<<<<<<<
 * 
 *     def get_field_index(self, name):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_field((__pyx_v_results[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 782, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/types.pxi":759
 *         return schema(fields, 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":784
 *             return pyarrow_wrap_field(results[0])
 * 
 *     def get_field_index(self, name):             # <<<<<<<<<<<<<<
 *         return self.schema.GetFieldIndex(tobytes(name))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_26get_field_index(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_25get_field_index[] = "Schema.get_field_index(self, name)";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_26get_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_25get_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_25get_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":785
 * 
 *     def get_field_index(self, name):
 *         return self.schema.GetFieldIndex(tobytes(name))             # <<<<<<<<<<<<<<
 * 
 *     def append(self, Field field):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 785, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_name);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 785, __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, 785, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->schema->GetFieldIndex(__pyx_t_4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 785, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":784
 *             return pyarrow_wrap_field(results[0])
 * 
 *     def get_field_index(self, name):             # <<<<<<<<<<<<<<
 *         return self.schema.GetFieldIndex(tobytes(name))
 * 
 */

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

/* "pyarrow/types.pxi":787
 *         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_28append(PyObject *__pyx_v_self, PyObject *__pyx_v_field); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_27append[] = "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_28append(PyObject *__pyx_v_self, PyObject *__pyx_v_field) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("append (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field), __pyx_ptype_7pyarrow_3lib_Field, 1, "field", 0))) __PYX_ERR(4, 787, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_27append(((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_27append(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":799
 *         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(4, 799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->schema->num_fields()); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, ((PyObject *)__pyx_v_field)};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 799, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, ((PyObject *)__pyx_v_field)};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 799, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 799, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_v_field));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_field));
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_field));
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 799, __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":787
 *         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":801
 *         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_30insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_29insert[] = "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_30insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_i;
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_field = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_i,&__pyx_n_s_field,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, 1); __PYX_ERR(4, 801, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insert") < 0)) __PYX_ERR(4, 801, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_i = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 801, __pyx_L3_error)
    __pyx_v_field = ((struct __pyx_obj_7pyarrow_3lib_Field *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 801, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Schema.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field), __pyx_ptype_7pyarrow_3lib_Field, 1, "field", 0))) __PYX_ERR(4, 801, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_29insert(((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_29insert(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":818
 *             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":820
 *         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":821
 * 
 *         with nogil:
 *             check_status(self.schema.AddField(i, c_field, &new_schema))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_schema(new_schema)
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->schema->AddField(__pyx_v_i, __pyx_v_c_field, (&__pyx_v_new_schema))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(4, 821, __pyx_L4_error)
      }

      /* "pyarrow/types.pxi":820
 *         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":823
 *             check_status(self.schema.AddField(i, c_field, &new_schema))
 * 
 *         return pyarrow_wrap_schema(new_schema)             # <<<<<<<<<<<<<<
 * 
 *     def remove(self, int i):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_new_schema); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":801
 *         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":825
 *         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_32remove(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_31remove[] = "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_32remove(PyObject *__pyx_v_self, PyObject *__pyx_arg_i) {
  int __pyx_v_i;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("remove (wrapper)", 0);
  assert(__pyx_arg_i); {
    __pyx_v_i = __Pyx_PyInt_As_int(__pyx_arg_i); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 825, __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_31remove(((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_31remove(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":839
 *         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":840
 * 
 *         with nogil:
 *             check_status(self.schema.RemoveField(i, &new_schema))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_schema(new_schema)
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->schema->RemoveField(__pyx_v_i, (&__pyx_v_new_schema))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 840, __pyx_L4_error)
      }

      /* "pyarrow/types.pxi":839
 *         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":842
 *             check_status(self.schema.RemoveField(i, &new_schema))
 * 
 *         return pyarrow_wrap_schema(new_schema)             # <<<<<<<<<<<<<<
 * 
 *     def set(self, int i, Field field):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_new_schema); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":825
 *         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":844
 *         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_34set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_33set[] = "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_34set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_i;
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_field = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_i,&__pyx_n_s_field,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, 1); __PYX_ERR(4, 844, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set") < 0)) __PYX_ERR(4, 844, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_i = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 844, __pyx_L3_error)
    __pyx_v_field = ((struct __pyx_obj_7pyarrow_3lib_Field *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 844, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Schema.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field), __pyx_ptype_7pyarrow_3lib_Field, 1, "field", 0))) __PYX_ERR(4, 844, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_33set(((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_33set(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":861
 *             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":863
 *         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":864
 * 
 *         with nogil:
 *             check_status(self.schema.SetField(i, c_field, &new_schema))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_schema(new_schema)
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->schema->SetField(__pyx_v_i, __pyx_v_c_field, (&__pyx_v_new_schema))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(4, 864, __pyx_L4_error)
      }

      /* "pyarrow/types.pxi":863
 *         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":866
 *             check_status(self.schema.SetField(i, c_field, &new_schema))
 * 
 *         return pyarrow_wrap_schema(new_schema)             # <<<<<<<<<<<<<<
 * 
 *     def add_metadata(self, metadata):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_new_schema); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_36add_metadata(PyObject *__pyx_v_self, PyObject *__pyx_v_metadata); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_35add_metadata[] = "Schema.add_metadata(self, metadata)\n\n        Add metadata as dict of string keys and values to Schema\n\n        Parameters\n        ----------\n        metadata : dict\n            Keys and values must be string-like / coercible to bytes\n\n        Returns\n        -------\n        schema : pyarrow.Schema\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_36add_metadata(PyObject *__pyx_v_self, PyObject *__pyx_v_metadata) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_metadata (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_35add_metadata(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self), ((PyObject *)__pyx_v_metadata));

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_35add_metadata(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_metadata) {
  std::shared_ptr< arrow::KeyValueMetadata>  __pyx_v_c_meta;
  std::shared_ptr< arrow::Schema>  __pyx_v_c_schema;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("add_metadata", 0);

  /* "pyarrow/types.pxi":885
 *             shared_ptr[CSchema] c_schema
 * 
 *         if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *             raise TypeError('Metadata must be an instance of dict')
 * 
 */
  __pyx_t_1 = PyDict_Check(__pyx_v_metadata); 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/types.pxi":886
 * 
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')             # <<<<<<<<<<<<<<
 * 
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 886, __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, 886, __pyx_L1_error)

    /* "pyarrow/types.pxi":885
 *             shared_ptr[CSchema] c_schema
 * 
 *         if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *             raise TypeError('Metadata must be an instance of dict')
 * 
 */
  }

  /* "pyarrow/types.pxi":888
 *             raise TypeError('Metadata must be an instance of dict')
 * 
 *         c_meta = pyarrow_unwrap_metadata(metadata)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             c_schema = self.schema.AddMetadata(c_meta)
 */
  __pyx_v_c_meta = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_metadata(__pyx_v_metadata);

  /* "pyarrow/types.pxi":889
 * 
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_schema = self.schema.AddMetadata(c_meta)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/types.pxi":890
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 *         with nogil:
 *             c_schema = self.schema.AddMetadata(c_meta)             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_schema(c_schema)
 */
        __pyx_v_c_schema = __pyx_v_self->schema->AddMetadata(__pyx_v_c_meta);
      }

      /* "pyarrow/types.pxi":889
 * 
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_schema = self.schema.AddMetadata(c_meta)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L6;
        }
        __pyx_L6:;
      }
  }

  /* "pyarrow/types.pxi":892
 *             c_schema = self.schema.AddMetadata(c_meta)
 * 
 *         return pyarrow_wrap_schema(c_schema)             # <<<<<<<<<<<<<<
 * 
 *     def serialize(self, memory_pool=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_c_schema); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 892, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Schema.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":894
 *         return pyarrow_wrap_schema(c_schema)
 * 
 *     def serialize(self, memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Write Schema to Buffer as encapsulated IPC message
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_38serialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_37serialize[] = "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_38serialize(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(4, 894, __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(4, 894, __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_37serialize(((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_37serialize(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":909
 *         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(4, 909, __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":911
 *             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":912
 * 
 *         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(4, 912, __pyx_L4_error)
      }

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

  /* "pyarrow/types.pxi":894
 *         return pyarrow_wrap_schema(c_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":916
 *         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_40remove_metadata(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_39remove_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_40remove_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_39remove_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_39remove_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":925
 *         """
 *         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":926
 *         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":925
 *         """
 *         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":927
 *         with nogil:
 *             new_schema = self.schema.RemoveMetadata()
 *         return pyarrow_wrap_schema(new_schema)             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_new_schema); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 927, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

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

        /* "pyarrow/types.pxi":934
 * 
 *         with nogil:
 *             check_status(             # <<<<<<<<<<<<<<
 *                 PrettyPrint(
 *                     deref(self.schema),
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::PrettyPrint((*__pyx_v_self->schema), arrow::PrettyPrintOptions(0), (&__pyx_v_result))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 934, __pyx_L4_error)
      }

      /* "pyarrow/types.pxi":933
 *             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":942
 *             )
 * 
 *         printed = frombytes(result)             # <<<<<<<<<<<<<<
 *         if self.metadata is not None:
 *             import pprint
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 942, __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":943
 * 
 *         printed = frombytes(result)
 *         if self.metadata is not None:             # <<<<<<<<<<<<<<
 *             import pprint
 *             metadata_formatted = pprint.pformat(self.metadata)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_metadata); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 943, __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":944
 *         printed = frombytes(result)
 *         if self.metadata is not None:
 *             import pprint             # <<<<<<<<<<<<<<
 *             metadata_formatted = pprint.pformat(self.metadata)
 *             printed += '\nmetadata\n--------\n' + metadata_formatted
 */
    __pyx_t_2 = __Pyx_Import(__pyx_n_s_pprint, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 944, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_pprint = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyarrow/types.pxi":945
 *         if self.metadata is not None:
 *             import pprint
 *             metadata_formatted = pprint.pformat(self.metadata)             # <<<<<<<<<<<<<<
 *             printed += '\nmetadata\n--------\n' + metadata_formatted
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pprint, __pyx_n_s_pformat); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 945, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_metadata); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 945, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 945, __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":946
 *             import pprint
 *             metadata_formatted = pprint.pformat(self.metadata)
 *             printed += '\nmetadata\n--------\n' + metadata_formatted             # <<<<<<<<<<<<<<
 * 
 *         return printed
 */
    __pyx_t_2 = PyNumber_Add(__pyx_kp_u_metadata_2, __pyx_v_metadata_formatted); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 946, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_printed, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 946, __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":943
 * 
 *         printed = frombytes(result)
 *         if self.metadata is not None:             # <<<<<<<<<<<<<<
 *             import pprint
 *             metadata_formatted = pprint.pformat(self.metadata)
 */
  }

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_44__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_44__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_43__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_43__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":951
 * 
 *     def __repr__(self):
 *         return self.__str__()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 951, __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, 951, __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":950
 *         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":957
 * 
 * 
 * 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":958
 * 
 * cdef DataType primitive_type(Type type):
 *     if type in _type_cache:             # <<<<<<<<<<<<<<
 *         return _type_cache[type]
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type(__pyx_v_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 958, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(__pyx_v_7pyarrow_3lib__type_cache == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(4, 958, __pyx_L1_error)
  }
  __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_t_1, __pyx_v_7pyarrow_3lib__type_cache, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 958, __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":959
 * cdef DataType primitive_type(Type type):
 *     if type in _type_cache:
 *         return _type_cache[type]             # <<<<<<<<<<<<<<
 * 
 *     cdef DataType out = DataType.__new__(DataType)
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    if (unlikely(__pyx_v_7pyarrow_3lib__type_cache == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(4, 959, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type(__pyx_v_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 959, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_7pyarrow_3lib__type_cache, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 959, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(4, 959, __pyx_L1_error)
    __pyx_r = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L0;

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

  /* "pyarrow/types.pxi":961
 *         return _type_cache[type]
 * 
 *     cdef DataType out = DataType.__new__(DataType)             # <<<<<<<<<<<<<<
 *     out.init(GetPrimitiveType(type))
 * 
 */
  __pyx_t_4 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_DataType(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_DataType), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 961, __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":962
 * 
 *     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":964
 *     out.init(GetPrimitiveType(type))
 * 
 *     _type_cache[type] = out             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
  if (unlikely(__pyx_v_7pyarrow_3lib__type_cache == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 964, __pyx_L1_error)
  }
  __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type(__pyx_v_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 964, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (unlikely(PyDict_SetItem(__pyx_v_7pyarrow_3lib__type_cache, __pyx_t_4, ((PyObject *)__pyx_v_out)) < 0)) __PYX_ERR(4, 964, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/types.pxi":965
 * 
 *     _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":957
 * 
 * 
 * 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":972
 * 
 * 
 * def field(name, type, bint nullable=True, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create a pyarrow.Field instance
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19field(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18field[] = "field(name, type, bool nullable=True, metadata=None)\n\n    Create a pyarrow.Field instance\n\n    Parameters\n    ----------\n    name : string or bytes\n    type : pyarrow.DataType\n    nullable : boolean, default True\n    metadata : dict, default None\n        Keys and values must be coercible to bytes\n\n    Returns\n    -------\n    field : pyarrow.Field\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_19field = {"field", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_19field, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_18field};
static PyObject *__pyx_pw_7pyarrow_3lib_19field(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(4, 972, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nullable);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_metadata);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "field") < 0)) __PYX_ERR(4, 972, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_name = values[0];
    __pyx_v_type = values[1];
    if (values[2]) {
      __pyx_v_nullable = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_nullable == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 972, __pyx_L3_error)
    } else {
      __pyx_v_nullable = ((int)1);
    }
    __pyx_v_metadata = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("field", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 972, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.field", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_18field(__pyx_self, __pyx_v_name, __pyx_v_type, __pyx_v_nullable, __pyx_v_metadata);

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

static PyObject *__pyx_pf_7pyarrow_3lib_18field(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name, PyObject *__pyx_v_type, int __pyx_v_nullable, PyObject *__pyx_v_metadata) {
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_result = 0;
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v__type = 0;
  std::shared_ptr< arrow::KeyValueMetadata>  __pyx_v_c_meta;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7pyarrow_3lib_ensure_type __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  std::string __pyx_t_7;
  __Pyx_RefNannySetupContext("field", 0);

  /* "pyarrow/types.pxi":989
 *     """
 *     cdef:
 *         Field result = Field.__new__(Field)             # <<<<<<<<<<<<<<
 *         DataType _type = ensure_type(type, allow_none=False)
 *         shared_ptr[CKeyValueMetadata] c_meta
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_Field(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_Field), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 989, __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":990
 *     cdef:
 *         Field result = Field.__new__(Field)
 *         DataType _type = ensure_type(type, allow_none=False)             # <<<<<<<<<<<<<<
 *         shared_ptr[CKeyValueMetadata] c_meta
 * 
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.allow_none = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_ensure_type(__pyx_v_type, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":993
 *         shared_ptr[CKeyValueMetadata] c_meta
 * 
 *     if metadata is not None:             # <<<<<<<<<<<<<<
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')
 */
  __pyx_t_3 = (__pyx_v_metadata != Py_None);
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/types.pxi":994
 * 
 *     if metadata is not None:
 *         if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *             raise TypeError('Metadata must be an instance of dict')
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 */
    __pyx_t_4 = PyDict_Check(__pyx_v_metadata); 
    __pyx_t_3 = ((!(__pyx_t_4 != 0)) != 0);
    if (unlikely(__pyx_t_3)) {

      /* "pyarrow/types.pxi":995
 *     if metadata is not None:
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')             # <<<<<<<<<<<<<<
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 995, __pyx_L1_error)
      __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, 995, __pyx_L1_error)

      /* "pyarrow/types.pxi":994
 * 
 *     if metadata is not None:
 *         if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *             raise TypeError('Metadata must be an instance of dict')
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 */
    }

    /* "pyarrow/types.pxi":996
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')
 *         c_meta = pyarrow_unwrap_metadata(metadata)             # <<<<<<<<<<<<<<
 * 
 *     result.sp_field.reset(
 */
    __pyx_v_c_meta = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_metadata(__pyx_v_metadata);

    /* "pyarrow/types.pxi":993
 *         shared_ptr[CKeyValueMetadata] c_meta
 * 
 *     if metadata is not None:             # <<<<<<<<<<<<<<
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')
 */
  }

  /* "pyarrow/types.pxi":999
 * 
 *     result.sp_field.reset(
 *         new CField(tobytes(name), _type.sp_type, nullable, c_meta)             # <<<<<<<<<<<<<<
 *     )
 *     result.field = result.sp_field.get()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_name);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 999, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

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

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

  /* "pyarrow/types.pxi":1002
 *     )
 *     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":1004
 *     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":972
 * 
 * 
 * def field(name, type, bint nullable=True, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create a pyarrow.Field instance
 */

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

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

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

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

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

  /* "pyarrow/types.pxi":1025
 *     Create instance of null type
 *     """
 *     return primitive_type(_Type_NA)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::NA)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

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

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

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

  /* "pyarrow/types.pxi":1032
 *     Create instance of boolean type
 *     """
 *     return primitive_type(_Type_BOOL)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::BOOL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1032, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

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

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

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

  /* "pyarrow/types.pxi":1039
 *     Create instance of unsigned int8 type
 *     """
 *     return primitive_type(_Type_UINT8)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::UINT8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1039, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

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

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

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

  /* "pyarrow/types.pxi":1046
 *     Create instance of signed int8 type
 *     """
 *     return primitive_type(_Type_INT8)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::INT8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1046, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

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

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

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

  /* "pyarrow/types.pxi":1053
 *     Create instance of unsigned uint16 type
 *     """
 *     return primitive_type(_Type_UINT16)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::UINT16)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

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

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

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

  /* "pyarrow/types.pxi":1060
 *     Create instance of signed int16 type
 *     """
 *     return primitive_type(_Type_INT16)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::INT16)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1060, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

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

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

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

  /* "pyarrow/types.pxi":1067
 *     Create instance of unsigned uint32 type
 *     """
 *     return primitive_type(_Type_UINT32)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::UINT32)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1067, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

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

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

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

  /* "pyarrow/types.pxi":1074
 *     Create instance of signed int32 type
 *     """
 *     return primitive_type(_Type_INT32)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::INT32)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

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

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

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

  /* "pyarrow/types.pxi":1081
 *     Create instance of unsigned uint64 type
 *     """
 *     return primitive_type(_Type_UINT64)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::UINT64)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

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

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

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

  /* "pyarrow/types.pxi":1088
 *     Create instance of signed int64 type
 *     """
 *     return primitive_type(_Type_INT64)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::INT64)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1084
 * 
 * 
 * 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":1095
 * 
 * 
 * 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":1096
 * 
 * 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":1097
 * cdef timeunit_to_string(TimeUnit unit):
 *     if unit == TimeUnit_SECOND:
 *         return 's'             # <<<<<<<<<<<<<<
 *     elif unit == TimeUnit_MILLI:
 *         return 'ms'
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_s);
    __pyx_r = __pyx_n_u_s;
    goto __pyx_L0;

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

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

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

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

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

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

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

  /* "pyarrow/types.pxi":1095
 * 
 * 
 * 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":1109
 * 
 * 
 * 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_41tzinfo_to_string(PyObject *__pyx_self, PyObject *__pyx_v_tz); /*proto*/
static char __pyx_doc_7pyarrow_3lib_40tzinfo_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_41tzinfo_to_string = {"tzinfo_to_string", (PyCFunction)__pyx_pw_7pyarrow_3lib_41tzinfo_to_string, METH_O, __pyx_doc_7pyarrow_3lib_40tzinfo_to_string};
static PyObject *__pyx_pw_7pyarrow_3lib_41tzinfo_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_40tzinfo_to_string(__pyx_self, ((PyObject *)__pyx_v_tz));

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

/* "pyarrow/types.pxi":1130
 *     import datetime
 * 
 *     def fixed_offset_to_string(offset):             # <<<<<<<<<<<<<<
 *         seconds = int(offset.utcoffset(None).total_seconds())
 *         sign = '+' if seconds >= 0 else '-'
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16tzinfo_to_string_1fixed_offset_to_string(PyObject *__pyx_self, PyObject *__pyx_v_offset); /*proto*/
static PyMethodDef __pyx_mdef_7pyarrow_3lib_16tzinfo_to_string_1fixed_offset_to_string = {"fixed_offset_to_string", (PyCFunction)__pyx_pw_7pyarrow_3lib_16tzinfo_to_string_1fixed_offset_to_string, METH_O, 0};
static PyObject *__pyx_pw_7pyarrow_3lib_16tzinfo_to_string_1fixed_offset_to_string(PyObject *__pyx_self, PyObject *__pyx_v_offset) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fixed_offset_to_string (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16tzinfo_to_string_fixed_offset_to_string(__pyx_self, ((PyObject *)__pyx_v_offset));

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

static PyObject *__pyx_pf_7pyarrow_3lib_16tzinfo_to_string_fixed_offset_to_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_offset) {
  PyObject *__pyx_v_seconds = NULL;
  PyObject *__pyx_v_sign = NULL;
  PyObject *__pyx_v_minutes = NULL;
  PyObject *__pyx_v_hours = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("fixed_offset_to_string", 0);

  /* "pyarrow/types.pxi":1131
 * 
 *     def fixed_offset_to_string(offset):
 *         seconds = int(offset.utcoffset(None).total_seconds())             # <<<<<<<<<<<<<<
 *         sign = '+' if seconds >= 0 else '-'
 *         minutes, seconds = divmod(abs(seconds), 60)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_offset, __pyx_n_s_utcoffset); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, Py_None) : __Pyx_PyObject_CallOneArg(__pyx_t_3, Py_None);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_total_seconds); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1131, __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, 1131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_seconds = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyarrow/types.pxi":1132
 *     def fixed_offset_to_string(offset):
 *         seconds = int(offset.utcoffset(None).total_seconds())
 *         sign = '+' if seconds >= 0 else '-'             # <<<<<<<<<<<<<<
 *         minutes, seconds = divmod(abs(seconds), 60)
 *         hours, minutes = divmod(minutes, 60)
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_seconds, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1132, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(4, 1132, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {
    __Pyx_INCREF(__pyx_kp_u__17);
    __pyx_t_3 = __pyx_kp_u__17;
  } else {
    __Pyx_INCREF(__pyx_kp_u__18);
    __pyx_t_3 = __pyx_kp_u__18;
  }
  __pyx_v_sign = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyarrow/types.pxi":1133
 *         seconds = int(offset.utcoffset(None).total_seconds())
 *         sign = '+' if seconds >= 0 else '-'
 *         minutes, seconds = divmod(abs(seconds), 60)             # <<<<<<<<<<<<<<
 *         hours, minutes = divmod(minutes, 60)
 *         if seconds > 0:
 */
  __pyx_t_3 = __Pyx_PyNumber_Absolute(__pyx_v_seconds); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyNumber_Divmod(__pyx_t_3, __pyx_int_60); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(4, 1133, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1133, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1133, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1133, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_2 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_4), 2) < 0) __PYX_ERR(4, 1133, __pyx_L1_error)
    __pyx_t_6 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(4, 1133, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_minutes = __pyx_t_3;
  __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_seconds, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":1134
 *         sign = '+' if seconds >= 0 else '-'
 *         minutes, seconds = divmod(abs(seconds), 60)
 *         hours, minutes = divmod(minutes, 60)             # <<<<<<<<<<<<<<
 *         if seconds > 0:
 *             raise ValueError('Offset must represent whole number of minutes')
 */
  __pyx_t_1 = PyNumber_Divmod(__pyx_v_minutes, __pyx_int_60); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(4, 1134, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1134, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1134, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1134, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_4), 2) < 0) __PYX_ERR(4, 1134, __pyx_L1_error)
    __pyx_t_6 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(4, 1134, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __pyx_v_hours = __pyx_t_2;
  __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_minutes, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyarrow/types.pxi":1135
 *         minutes, seconds = divmod(abs(seconds), 60)
 *         hours, minutes = divmod(minutes, 60)
 *         if seconds > 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Offset must represent whole number of minutes')
 *         return '{}{:02d}:{:02d}'.format(sign, hours, minutes)
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_seconds, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1135, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(4, 1135, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_5)) {

    /* "pyarrow/types.pxi":1136
 *         hours, minutes = divmod(minutes, 60)
 *         if seconds > 0:
 *             raise ValueError('Offset must represent whole number of minutes')             # <<<<<<<<<<<<<<
 *         return '{}{:02d}:{:02d}'.format(sign, hours, minutes)
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1136, __pyx_L1_error)
    __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, 1136, __pyx_L1_error)

    /* "pyarrow/types.pxi":1135
 *         minutes, seconds = divmod(abs(seconds), 60)
 *         hours, minutes = divmod(minutes, 60)
 *         if seconds > 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Offset must represent whole number of minutes')
 *         return '{}{:02d}:{:02d}'.format(sign, hours, minutes)
 */
  }

  /* "pyarrow/types.pxi":1137
 *         if seconds > 0:
 *             raise ValueError('Offset must represent whole number of minutes')
 *         return '{}{:02d}:{:02d}'.format(sign, hours, minutes)             # <<<<<<<<<<<<<<
 * 
 *     if tz is pytz.utc:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_02d_02d, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_sign, __pyx_v_hours, __pyx_v_minutes};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1137, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_sign, __pyx_v_hours, __pyx_v_minutes};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1137, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_4 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_sign);
    __Pyx_GIVEREF(__pyx_v_sign);
    PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_7, __pyx_v_sign);
    __Pyx_INCREF(__pyx_v_hours);
    __Pyx_GIVEREF(__pyx_v_hours);
    PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_7, __pyx_v_hours);
    __Pyx_INCREF(__pyx_v_minutes);
    __Pyx_GIVEREF(__pyx_v_minutes);
    PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_7, __pyx_v_minutes);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1130
 *     import datetime
 * 
 *     def fixed_offset_to_string(offset):             # <<<<<<<<<<<<<<
 *         seconds = int(offset.utcoffset(None).total_seconds())
 *         sign = '+' if seconds >= 0 else '-'
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.tzinfo_to_string.fixed_offset_to_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_seconds);
  __Pyx_XDECREF(__pyx_v_sign);
  __Pyx_XDECREF(__pyx_v_minutes);
  __Pyx_XDECREF(__pyx_v_hours);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1109
 * 
 * 
 * def tzinfo_to_string(tz):             # <<<<<<<<<<<<<<
 *     """
 *     Converts a time zone object into a string indicating the name of a time
 */

static PyObject *__pyx_pf_7pyarrow_3lib_40tzinfo_to_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tz) {
  PyObject *__pyx_v_pytz = NULL;
  PyObject *__pyx_v_datetime = NULL;
  PyObject *__pyx_v_fixed_offset_to_string = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("tzinfo_to_string", 0);

  /* "pyarrow/types.pxi":1127
 *         Time zone name
 *     """
 *     import pytz             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_pytz, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_pytz = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1128
 *     """
 *     import pytz
 *     import datetime             # <<<<<<<<<<<<<<
 * 
 *     def fixed_offset_to_string(offset):
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_datetime, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_datetime = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1130
 *     import datetime
 * 
 *     def fixed_offset_to_string(offset):             # <<<<<<<<<<<<<<
 *         seconds = int(offset.utcoffset(None).total_seconds())
 *         sign = '+' if seconds >= 0 else '-'
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_16tzinfo_to_string_1fixed_offset_to_string, 0, __pyx_n_s_tzinfo_to_string_locals_fixed_of, NULL, __pyx_n_s_pyarrow_lib, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_fixed_offset_to_string = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1139
 *         return '{}{:02d}:{:02d}'.format(sign, hours, minutes)
 * 
 *     if tz is pytz.utc:             # <<<<<<<<<<<<<<
 *         return tz.zone  # ARROW-4055
 *     elif isinstance(tz, pytz.tzinfo.BaseTzInfo):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pytz, __pyx_n_s_utc); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_v_tz == __pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/types.pxi":1140
 * 
 *     if tz is pytz.utc:
 *         return tz.zone  # ARROW-4055             # <<<<<<<<<<<<<<
 *     elif isinstance(tz, pytz.tzinfo.BaseTzInfo):
 *         return tz.zone
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_zone); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1140, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1139
 *         return '{}{:02d}:{:02d}'.format(sign, hours, minutes)
 * 
 *     if tz is pytz.utc:             # <<<<<<<<<<<<<<
 *         return tz.zone  # ARROW-4055
 *     elif isinstance(tz, pytz.tzinfo.BaseTzInfo):
 */
  }

  /* "pyarrow/types.pxi":1141
 *     if tz is pytz.utc:
 *         return tz.zone  # ARROW-4055
 *     elif isinstance(tz, pytz.tzinfo.BaseTzInfo):             # <<<<<<<<<<<<<<
 *         return tz.zone
 *     elif isinstance(tz, pytz._FixedOffset):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pytz, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_BaseTzInfo); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_tz, __pyx_t_4); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 1141, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/types.pxi":1142
 *         return tz.zone  # ARROW-4055
 *     elif isinstance(tz, pytz.tzinfo.BaseTzInfo):
 *         return tz.zone             # <<<<<<<<<<<<<<
 *     elif isinstance(tz, pytz._FixedOffset):
 *         return fixed_offset_to_string(tz)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_zone); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1141
 *     if tz is pytz.utc:
 *         return tz.zone  # ARROW-4055
 *     elif isinstance(tz, pytz.tzinfo.BaseTzInfo):             # <<<<<<<<<<<<<<
 *         return tz.zone
 *     elif isinstance(tz, pytz._FixedOffset):
 */
  }

  /* "pyarrow/types.pxi":1143
 *     elif isinstance(tz, pytz.tzinfo.BaseTzInfo):
 *         return tz.zone
 *     elif isinstance(tz, pytz._FixedOffset):             # <<<<<<<<<<<<<<
 *         return fixed_offset_to_string(tz)
 *     elif isinstance(tz, datetime.tzinfo):
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pytz, __pyx_n_s_FixedOffset); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_tz, __pyx_t_4); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(4, 1143, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/types.pxi":1144
 *         return tz.zone
 *     elif isinstance(tz, pytz._FixedOffset):
 *         return fixed_offset_to_string(tz)             # <<<<<<<<<<<<<<
 *     elif isinstance(tz, datetime.tzinfo):
 *         if six.PY3 and isinstance(tz, datetime.timezone):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __pyx_pf_7pyarrow_3lib_16tzinfo_to_string_fixed_offset_to_string(__pyx_v_fixed_offset_to_string, __pyx_v_tz); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1143
 *     elif isinstance(tz, pytz.tzinfo.BaseTzInfo):
 *         return tz.zone
 *     elif isinstance(tz, pytz._FixedOffset):             # <<<<<<<<<<<<<<
 *         return fixed_offset_to_string(tz)
 *     elif isinstance(tz, datetime.tzinfo):
 */
  }

  /* "pyarrow/types.pxi":1145
 *     elif isinstance(tz, pytz._FixedOffset):
 *         return fixed_offset_to_string(tz)
 *     elif isinstance(tz, datetime.tzinfo):             # <<<<<<<<<<<<<<
 *         if six.PY3 and isinstance(tz, datetime.timezone):
 *             return fixed_offset_to_string(tz)
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_tz, __pyx_t_4); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 1145, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (likely(__pyx_t_2)) {

    /* "pyarrow/types.pxi":1146
 *         return fixed_offset_to_string(tz)
 *     elif isinstance(tz, datetime.tzinfo):
 *         if six.PY3 and isinstance(tz, datetime.timezone):             # <<<<<<<<<<<<<<
 *             return fixed_offset_to_string(tz)
 *         else:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_six); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_PY3); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(4, 1146, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_3) {
    } else {
      __pyx_t_2 = __pyx_t_3;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timezone); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_IsInstance(__pyx_v_tz, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 1146, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = (__pyx_t_3 != 0);
    __pyx_t_2 = __pyx_t_5;
    __pyx_L5_bool_binop_done:;
    if (likely(__pyx_t_2)) {

      /* "pyarrow/types.pxi":1147
 *     elif isinstance(tz, datetime.tzinfo):
 *         if six.PY3 and isinstance(tz, datetime.timezone):
 *             return fixed_offset_to_string(tz)             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError('Unable to convert timezone `{}` to string'
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __pyx_pf_7pyarrow_3lib_16tzinfo_to_string_fixed_offset_to_string(__pyx_v_fixed_offset_to_string, __pyx_v_tz); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "pyarrow/types.pxi":1146
 *         return fixed_offset_to_string(tz)
 *     elif isinstance(tz, datetime.tzinfo):
 *         if six.PY3 and isinstance(tz, datetime.timezone):             # <<<<<<<<<<<<<<
 *             return fixed_offset_to_string(tz)
 *         else:
 */
    }

    /* "pyarrow/types.pxi":1149
 *             return fixed_offset_to_string(tz)
 *         else:
 *             raise ValueError('Unable to convert timezone `{}` to string'             # <<<<<<<<<<<<<<
 *                              .format(tz))
 *     else:
 */
    /*else*/ {

      /* "pyarrow/types.pxi":1150
 *         else:
 *             raise ValueError('Unable to convert timezone `{}` to string'
 *                              .format(tz))             # <<<<<<<<<<<<<<
 *     else:
 *         raise TypeError('Must be an instance of `datetime.tzinfo`')
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unable_to_convert_timezone_to_st, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1150, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_v_tz) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_tz);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1150, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "pyarrow/types.pxi":1149
 *             return fixed_offset_to_string(tz)
 *         else:
 *             raise ValueError('Unable to convert timezone `{}` to string'             # <<<<<<<<<<<<<<
 *                              .format(tz))
 *     else:
 */
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1149, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(4, 1149, __pyx_L1_error)
    }

    /* "pyarrow/types.pxi":1145
 *     elif isinstance(tz, pytz._FixedOffset):
 *         return fixed_offset_to_string(tz)
 *     elif isinstance(tz, datetime.tzinfo):             # <<<<<<<<<<<<<<
 *         if six.PY3 and isinstance(tz, datetime.timezone):
 *             return fixed_offset_to_string(tz)
 */
  }

  /* "pyarrow/types.pxi":1152
 *                              .format(tz))
 *     else:
 *         raise TypeError('Must be an instance of `datetime.tzinfo`')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1152, __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, 1152, __pyx_L1_error)
  }

  /* "pyarrow/types.pxi":1109
 * 
 * 
 * def tzinfo_to_string(tz):             # <<<<<<<<<<<<<<
 *     """
 *     Converts a time zone object into a string indicating the name of a time
 */

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

/* "pyarrow/types.pxi":1155
 * 
 * 
 * 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_43string_to_tzinfo(PyObject *__pyx_self, PyObject *__pyx_v_name); /*proto*/
static char __pyx_doc_7pyarrow_3lib_42string_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_43string_to_tzinfo = {"string_to_tzinfo", (PyCFunction)__pyx_pw_7pyarrow_3lib_43string_to_tzinfo, METH_O, __pyx_doc_7pyarrow_3lib_42string_to_tzinfo};
static PyObject *__pyx_pw_7pyarrow_3lib_43string_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_42string_to_tzinfo(__pyx_self, ((PyObject *)__pyx_v_name));

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

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

  /* "pyarrow/types.pxi":1174
 *     """
 *     import pytz
 *     m = _FIXED_OFFSET_RE.match(name)             # <<<<<<<<<<<<<<
 *     if m:
 *         sign = 1 if m.group(1) == '+' else -1
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FIXED_OFFSET_RE); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_match); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_name);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1174, __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":1175
 *     import pytz
 *     m = _FIXED_OFFSET_RE.match(name)
 *     if m:             # <<<<<<<<<<<<<<
 *         sign = 1 if m.group(1) == '+' else -1
 *         hours, minutes = map(int, m.group(2, 3))
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_m); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(4, 1175, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "pyarrow/types.pxi":1176
 *     m = _FIXED_OFFSET_RE.match(name)
 *     if m:
 *         sign = 1 if m.group(1) == '+' else -1             # <<<<<<<<<<<<<<
 *         hours, minutes = map(int, m.group(2, 3))
 *         return pytz.FixedOffset(sign * (hours * 60 + minutes))
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_group); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_int_1);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_kp_u__17, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(4, 1176, __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":1177
 *     if m:
 *         sign = 1 if m.group(1) == '+' else -1
 *         hours, minutes = map(int, m.group(2, 3))             # <<<<<<<<<<<<<<
 *         return pytz.FixedOffset(sign * (hours * 60 + minutes))
 *     else:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_group); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
    __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&PyInt_Type)));
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
      PyObject* sequence = __pyx_t_3;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(4, 1177, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      #else
      __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1177, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1177, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1177, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
      index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(4, 1177, __pyx_L1_error)
      __pyx_t_6 = NULL;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L5_unpacking_done;
      __pyx_L4_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(4, 1177, __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":1178
 *         sign = 1 if m.group(1) == '+' else -1
 *         hours, minutes = map(int, m.group(2, 3))
 *         return pytz.FixedOffset(sign * (hours * 60 + minutes))             # <<<<<<<<<<<<<<
 *     else:
 *         return pytz.timezone(name)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pytz, __pyx_n_s_FixedOffset_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1178, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyNumber_Multiply(__pyx_v_hours, __pyx_int_60); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1178, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_v_minutes); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1178, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Multiply(__pyx_v_sign, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1178, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1178, __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":1175
 *     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":1180
 *         return pytz.FixedOffset(sign * (hours * 60 + minutes))
 *     else:
 *         return pytz.timezone(name)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pytz, __pyx_n_s_timezone); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_name);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1180, __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":1155
 * 
 * 
 * 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":1183
 * 
 * 
 * def timestamp(unit, tz=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of timestamp type with resolution and optional time zone
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_45timestamp(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_44timestamp[] = "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_45timestamp = {"timestamp", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_45timestamp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_44timestamp};
static PyObject *__pyx_pw_7pyarrow_3lib_45timestamp(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_unit = 0;
  PyObject *__pyx_v_tz = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("timestamp (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unit,&__pyx_n_s_tz,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unit)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tz);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timestamp") < 0)) __PYX_ERR(4, 1183, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_unit = values[0];
    __pyx_v_tz = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("timestamp", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 1183, __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_44timestamp(__pyx_self, __pyx_v_unit, __pyx_v_tz);

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

static PyObject *__pyx_pf_7pyarrow_3lib_44timestamp(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":1210
 *         c_string c_timezone
 * 
 *     if unit == "s":             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_SECOND
 *     elif unit == 'ms':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_s, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1210, __pyx_L1_error)
  if (__pyx_t_1) {

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

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

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

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

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

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

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

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

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

  /* "pyarrow/types.pxi":1221
 *         raise ValueError('Invalid TimeUnit string')
 * 
 *     cdef TimestampType out = TimestampType.__new__(TimestampType)             # <<<<<<<<<<<<<<
 * 
 *     if tz is None:
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_TimestampType(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_TimestampType), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1221, __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":1223
 *     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":1224
 * 
 *     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":1225
 *     if tz is None:
 *         out.init(ctimestamp(unit_code))
 *         if unit_code in _timestamp_type_cache:             # <<<<<<<<<<<<<<
 *             return _timestamp_type_cache[unit_code]
 *         _timestamp_type_cache[unit_code] = out
 */
    __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(__pyx_v_unit_code); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1225, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(__pyx_v_7pyarrow_3lib__timestamp_type_cache == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(4, 1225, __pyx_L1_error)
    }
    __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_t_2, __pyx_v_7pyarrow_3lib__timestamp_type_cache, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(4, 1225, __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":1226
 *         out.init(ctimestamp(unit_code))
 *         if unit_code in _timestamp_type_cache:
 *             return _timestamp_type_cache[unit_code]             # <<<<<<<<<<<<<<
 *         _timestamp_type_cache[unit_code] = out
 *     else:
 */
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(__pyx_v_7pyarrow_3lib__timestamp_type_cache == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(4, 1226, __pyx_L1_error)
      }
      __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(__pyx_v_unit_code); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1226, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_7pyarrow_3lib__timestamp_type_cache, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1226, __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":1225
 *     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":1227
 *         if unit_code in _timestamp_type_cache:
 *             return _timestamp_type_cache[unit_code]
 *         _timestamp_type_cache[unit_code] = out             # <<<<<<<<<<<<<<
 *     else:
 *         if not isinstance(tz, six.string_types):
 */
    if (unlikely(__pyx_v_7pyarrow_3lib__timestamp_type_cache == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(4, 1227, __pyx_L1_error)
    }
    __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(__pyx_v_unit_code); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1227, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(PyDict_SetItem(__pyx_v_7pyarrow_3lib__timestamp_type_cache, __pyx_t_4, ((PyObject *)__pyx_v_out)) < 0)) __PYX_ERR(4, 1227, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/types.pxi":1223
 *     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":1229
 *         _timestamp_type_cache[unit_code] = out
 *     else:
 *         if not isinstance(tz, six.string_types):             # <<<<<<<<<<<<<<
 *             tz = tzinfo_to_string(tz)
 * 
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_six); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_string_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = PyObject_IsInstance(__pyx_v_tz, __pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 1229, __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":1230
 *     else:
 *         if not isinstance(tz, six.string_types):
 *             tz = tzinfo_to_string(tz)             # <<<<<<<<<<<<<<
 * 
 *         c_timezone = tobytes(tz)
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_tzinfo_to_string); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1230, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_tz) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_tz);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1230, __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":1229
 *         _timestamp_type_cache[unit_code] = out
 *     else:
 *         if not isinstance(tz, six.string_types):             # <<<<<<<<<<<<<<
 *             tz = tzinfo_to_string(tz)
 * 
 */
    }

    /* "pyarrow/types.pxi":1232
 *             tz = tzinfo_to_string(tz)
 * 
 *         c_timezone = tobytes(tz)             # <<<<<<<<<<<<<<
 *         out.init(ctimestamp(unit_code, c_timezone))
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_tz) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_tz);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1232, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_c_timezone = __pyx_t_6;

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

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

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

static PyObject *__pyx_pf_7pyarrow_3lib_46time32(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":1258
 *         c_string c_timezone
 * 
 *     if unit == 's':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_SECOND
 *     elif unit == 'ms':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_s, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1258, __pyx_L1_error)
  if (__pyx_t_1) {

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

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

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

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

  /* "pyarrow/types.pxi":1263
 *         unit_code = TimeUnit_MILLI
 *     else:
 *         raise ValueError('Invalid TimeUnit for time32: {}'.format(unit))             # <<<<<<<<<<<<<<
 * 
 *     if unit_code in _time_type_cache:
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Invalid_TimeUnit_for_time32, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_unit) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_unit);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(4, 1263, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/types.pxi":1265
 *         raise ValueError('Invalid TimeUnit for time32: {}'.format(unit))
 * 
 *     if unit_code in _time_type_cache:             # <<<<<<<<<<<<<<
 *         return _time_type_cache[unit_code]
 * 
 */
  __pyx_t_3 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(__pyx_v_unit_code); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (unlikely(__pyx_v_7pyarrow_3lib__time_type_cache == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(4, 1265, __pyx_L1_error)
  }
  __pyx_t_1 = (__Pyx_PyDict_ContainsTF(__pyx_t_3, __pyx_v_7pyarrow_3lib__time_type_cache, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1265, __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":1266
 * 
 *     if unit_code in _time_type_cache:
 *         return _time_type_cache[unit_code]             # <<<<<<<<<<<<<<
 * 
 *     cdef Time32Type out = Time32Type.__new__(Time32Type)
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(__pyx_v_7pyarrow_3lib__time_type_cache == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(4, 1266, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(__pyx_v_unit_code); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1266, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_7pyarrow_3lib__time_type_cache, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1266, __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":1265
 *         raise ValueError('Invalid TimeUnit for time32: {}'.format(unit))
 * 
 *     if unit_code in _time_type_cache:             # <<<<<<<<<<<<<<
 *         return _time_type_cache[unit_code]
 * 
 */
  }

  /* "pyarrow/types.pxi":1268
 *         return _time_type_cache[unit_code]
 * 
 *     cdef Time32Type out = Time32Type.__new__(Time32Type)             # <<<<<<<<<<<<<<
 * 
 *     out.init(ctime32(unit_code))
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_Time32Type(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_Time32Type), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1268, __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":1270
 *     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":1271
 * 
 *     out.init(ctime32(unit_code))
 *     _time_type_cache[unit_code] = out             # <<<<<<<<<<<<<<
 * 
 *     return out
 */
  if (unlikely(__pyx_v_7pyarrow_3lib__time_type_cache == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 1271, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(__pyx_v_unit_code); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(PyDict_SetItem(__pyx_v_7pyarrow_3lib__time_type_cache, __pyx_t_2, ((PyObject *)__pyx_v_out)) < 0)) __PYX_ERR(4, 1271, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

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

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

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

static PyObject *__pyx_pf_7pyarrow_3lib_48time64(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":1296
 *         c_string c_timezone
 * 
 *     if unit == 'us':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_MICRO
 *     elif unit == 'ns':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_us, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1296, __pyx_L1_error)
  if (__pyx_t_1) {

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

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

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

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

  /* "pyarrow/types.pxi":1301
 *         unit_code = TimeUnit_NANO
 *     else:
 *         raise ValueError('Invalid TimeUnit for time64: {}'.format(unit))             # <<<<<<<<<<<<<<
 * 
 *     if unit_code in _time_type_cache:
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Invalid_TimeUnit_for_time64, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1301, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_unit) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_unit);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1301, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1301, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(4, 1301, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/types.pxi":1303
 *         raise ValueError('Invalid TimeUnit for time64: {}'.format(unit))
 * 
 *     if unit_code in _time_type_cache:             # <<<<<<<<<<<<<<
 *         return _time_type_cache[unit_code]
 * 
 */
  __pyx_t_3 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(__pyx_v_unit_code); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (unlikely(__pyx_v_7pyarrow_3lib__time_type_cache == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(4, 1303, __pyx_L1_error)
  }
  __pyx_t_1 = (__Pyx_PyDict_ContainsTF(__pyx_t_3, __pyx_v_7pyarrow_3lib__time_type_cache, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1303, __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":1304
 * 
 *     if unit_code in _time_type_cache:
 *         return _time_type_cache[unit_code]             # <<<<<<<<<<<<<<
 * 
 *     cdef Time64Type out = Time64Type.__new__(Time64Type)
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(__pyx_v_7pyarrow_3lib__time_type_cache == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(4, 1304, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(__pyx_v_unit_code); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_7pyarrow_3lib__time_type_cache, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1304, __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":1303
 *         raise ValueError('Invalid TimeUnit for time64: {}'.format(unit))
 * 
 *     if unit_code in _time_type_cache:             # <<<<<<<<<<<<<<
 *         return _time_type_cache[unit_code]
 * 
 */
  }

  /* "pyarrow/types.pxi":1306
 *         return _time_type_cache[unit_code]
 * 
 *     cdef Time64Type out = Time64Type.__new__(Time64Type)             # <<<<<<<<<<<<<<
 * 
 *     out.init(ctime64(unit_code))
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_Time64Type(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_Time64Type), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1306, __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":1308
 *     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":1309
 * 
 *     out.init(ctime64(unit_code))
 *     _time_type_cache[unit_code] = out             # <<<<<<<<<<<<<<
 * 
 *     return out
 */
  if (unlikely(__pyx_v_7pyarrow_3lib__time_type_cache == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 1309, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(__pyx_v_unit_code); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(PyDict_SetItem(__pyx_v_7pyarrow_3lib__time_type_cache, __pyx_t_2, ((PyObject *)__pyx_v_out)) < 0)) __PYX_ERR(4, 1309, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

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

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

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

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

  /* "pyarrow/types.pxi":1318
 *     Create instance of 32-bit date (days since UNIX epoch 1970-01-01)
 *     """
 *     return primitive_type(_Type_DATE32)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::DATE32)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

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

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

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

  /* "pyarrow/types.pxi":1325
 *     Create instance of 64-bit date (milliseconds since UNIX epoch 1970-01-01)
 *     """
 *     return primitive_type(_Type_DATE64)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::DATE64)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

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

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

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

  /* "pyarrow/types.pxi":1332
 *     Create half-precision floating point type
 *     """
 *     return primitive_type(_Type_HALF_FLOAT)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::HALF_FLOAT)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

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

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

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

  /* "pyarrow/types.pxi":1339
 *     Create single-precision floating point type
 *     """
 *     return primitive_type(_Type_FLOAT)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::FLOAT)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

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

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

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

  /* "pyarrow/types.pxi":1346
 *     Create double-precision floating point type
 *     """
 *     return primitive_type(_Type_DOUBLE)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::DOUBLE)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

static PyObject *__pyx_pw_7pyarrow_3lib_61decimal128(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_f_7pyarrow_3lib_decimal128(int __pyx_v_precision, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7pyarrow_3lib_decimal128 *__pyx_optional_args) {
  int __pyx_v_scale = ((int)0);
  std::shared_ptr< arrow::DataType>  __pyx_v_decimal_type;
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("decimal128", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_scale = __pyx_optional_args->scale;
    }
  }

  /* "pyarrow/types.pxi":1363
 *     """
 *     cdef shared_ptr[CDataType] decimal_type
 *     if precision < 1 or precision > 38:             # <<<<<<<<<<<<<<
 *         raise ValueError("precision should be between 1 and 38")
 *     decimal_type.reset(new CDecimal128Type(precision, scale))
 */
  __pyx_t_2 = ((__pyx_v_precision < 1) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_precision > 38) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/types.pxi":1364
 *     cdef shared_ptr[CDataType] decimal_type
 *     if precision < 1 or precision > 38:
 *         raise ValueError("precision should be between 1 and 38")             # <<<<<<<<<<<<<<
 *     decimal_type.reset(new CDecimal128Type(precision, scale))
 *     return pyarrow_wrap_data_type(decimal_type)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1364, __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, 1364, __pyx_L1_error)

    /* "pyarrow/types.pxi":1363
 *     """
 *     cdef shared_ptr[CDataType] decimal_type
 *     if precision < 1 or precision > 38:             # <<<<<<<<<<<<<<
 *         raise ValueError("precision should be between 1 and 38")
 *     decimal_type.reset(new CDecimal128Type(precision, scale))
 */
  }

  /* "pyarrow/types.pxi":1365
 *     if precision < 1 or precision > 38:
 *         raise ValueError("precision should be between 1 and 38")
 *     decimal_type.reset(new CDecimal128Type(precision, scale))             # <<<<<<<<<<<<<<
 *     return pyarrow_wrap_data_type(decimal_type)
 * 
 */
  __pyx_v_decimal_type.reset(new  arrow::Decimal128Type(__pyx_v_precision, __pyx_v_scale));

  /* "pyarrow/types.pxi":1366
 *         raise ValueError("precision should be between 1 and 38")
 *     decimal_type.reset(new CDecimal128Type(precision, scale))
 *     return pyarrow_wrap_data_type(decimal_type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_decimal_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(4, 1366, __pyx_L1_error)
  __pyx_r = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1349
 * 
 * 
 * cpdef DataType decimal128(int precision, int scale=0):             # <<<<<<<<<<<<<<
 *     """
 *     Create decimal type with precision and scale and 128bit width
 */

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_61decimal128(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_60decimal128[] = "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_61decimal128(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_precision;
  int __pyx_v_scale;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decimal128 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_precision,&__pyx_n_s_scale,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_precision)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_scale);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decimal128") < 0)) __PYX_ERR(4, 1349, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_precision = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_precision == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1349, __pyx_L3_error)
    if (values[1]) {
      __pyx_v_scale = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_scale == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1349, __pyx_L3_error)
    } else {
      __pyx_v_scale = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("decimal128", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 1349, __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_60decimal128(__pyx_self, __pyx_v_precision, __pyx_v_scale);

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

static PyObject *__pyx_pf_7pyarrow_3lib_60decimal128(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_precision, int __pyx_v_scale) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7pyarrow_3lib_decimal128 __pyx_t_2;
  __Pyx_RefNannySetupContext("decimal128", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.scale = __pyx_v_scale;
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_decimal128(__pyx_v_precision, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1349, __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":1369
 * 
 * 
 * def string():             # <<<<<<<<<<<<<<
 *     """
 *     Create UTF8 variable-length string type
 */

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

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

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

  /* "pyarrow/types.pxi":1373
 *     Create UTF8 variable-length string type
 *     """
 *     return primitive_type(_Type_STRING)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::STRING)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1369
 * 
 * 
 * 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":1376
 * 
 * 
 * def utf8():             # <<<<<<<<<<<<<<
 *     """
 *     Alias for string()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_65utf8(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_64utf8[] = "utf8()\n\n    Alias for string()\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_65utf8 = {"utf8", (PyCFunction)__pyx_pw_7pyarrow_3lib_65utf8, METH_NOARGS, __pyx_doc_7pyarrow_3lib_64utf8};
static PyObject *__pyx_pw_7pyarrow_3lib_65utf8(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("utf8 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_64utf8(__pyx_self);

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

static PyObject *__pyx_pf_7pyarrow_3lib_64utf8(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("utf8", 0);

  /* "pyarrow/types.pxi":1380
 *     Alias for string()
 *     """
 *     return string()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_string); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1380, __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, 1380, __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":1376
 * 
 * 
 * def utf8():             # <<<<<<<<<<<<<<
 *     """
 *     Alias for string()
 */

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

/* "pyarrow/types.pxi":1383
 * 
 * 
 * def binary(int length=-1):             # <<<<<<<<<<<<<<
 *     """
 *     Create variable-length binary type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_67binary(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_66binary[] = "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_67binary = {"binary", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_67binary, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_66binary};
static PyObject *__pyx_pw_7pyarrow_3lib_67binary(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_length;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("binary (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_length,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_length);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "binary") < 0)) __PYX_ERR(4, 1383, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_length = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_length == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1383, __pyx_L3_error)
    } else {
      __pyx_v_length = ((int)-1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("binary", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 1383, __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_66binary(__pyx_self, __pyx_v_length);

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

static PyObject *__pyx_pf_7pyarrow_3lib_66binary(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":1394
 *         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":1395
 *     """
 *     if length == -1:
 *         return primitive_type(_Type_BINARY)             # <<<<<<<<<<<<<<
 * 
 *     cdef shared_ptr[CDataType] fixed_size_binary_type
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::BINARY)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1395, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

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

  /* "pyarrow/types.pxi":1398
 * 
 *     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":1399
 *     cdef shared_ptr[CDataType] fixed_size_binary_type
 *     fixed_size_binary_type.reset(new CFixedSizeBinaryType(length))
 *     return pyarrow_wrap_data_type(fixed_size_binary_type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_fixed_size_binary_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

static PyObject *__pyx_pw_7pyarrow_3lib_69list_(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":1418
 *         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(4, 1418, __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":1420
 *         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":1421
 * 
 *     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":1420
 *         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":1422
 *     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":1423
 *         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 TypeError('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":1422
 *     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":1425
 *         list_type.reset(new CListType((<Field> value_type).sp_field))
 *     else:
 *         raise TypeError('List requires DataType or Field')             # <<<<<<<<<<<<<<
 * 
 *     out.init(list_type)
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1425, __pyx_L1_error)
    __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, 1425, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/types.pxi":1427
 *         raise TypeError('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":1428
 * 
 *     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":1402
 * 
 * 
 * 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_69list_(PyObject *__pyx_self, PyObject *__pyx_v_value_type); /*proto*/
static char __pyx_doc_7pyarrow_3lib_68list_[] = "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_69list_(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_68list_(__pyx_self, ((PyObject *)__pyx_v_value_type));

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

static PyObject *__pyx_pf_7pyarrow_3lib_68list_(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(4, 1402, __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":1431
 * 
 * 
 * cpdef DictionaryType dictionary(DataType index_type, Array dict_values,             # <<<<<<<<<<<<<<
 *                                 bint ordered=False):
 *     """
 */

static PyObject *__pyx_pw_7pyarrow_3lib_71dictionary(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":1432
 * 
 * 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":1446
 *     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(4, 1446, __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":1448
 *     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":1451
 *                                         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":1452
 *                                         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":1431
 * 
 * 
 * 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_71dictionary(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_70dictionary[] = "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_71dictionary(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(4, 1431, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ordered);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dictionary") < 0)) __PYX_ERR(4, 1431, __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(4, 1432, __pyx_L3_error)
    } else {

      /* "pyarrow/types.pxi":1432
 * 
 * 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(4, 1431, __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(4, 1431, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dict_values), __pyx_ptype_7pyarrow_3lib_Array, 1, "dict_values", 0))) __PYX_ERR(4, 1431, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_70dictionary(__pyx_self, __pyx_v_index_type, __pyx_v_dict_values, __pyx_v_ordered);

  /* "pyarrow/types.pxi":1431
 * 
 * 
 * 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_70dictionary(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(4, 1431, __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":1455
 * 
 * 
 * def struct(fields):             # <<<<<<<<<<<<<<
 *     """
 *     Create StructType instance from fields
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_73struct(PyObject *__pyx_self, PyObject *__pyx_v_fields); /*proto*/
static char __pyx_doc_7pyarrow_3lib_72struct[] = "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_73struct = {"struct", (PyCFunction)__pyx_pw_7pyarrow_3lib_73struct, METH_O, __pyx_doc_7pyarrow_3lib_72struct};
static PyObject *__pyx_pw_7pyarrow_3lib_73struct(PyObject *__pyx_self, PyObject *__pyx_v_fields) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("struct (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_72struct(__pyx_self, ((PyObject *)__pyx_v_fields));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_72struct(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":1489
 *         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(4, 1489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Mapping); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_fields, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 1489, __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":1490
 * 
 *     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(4, 1490, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1490, __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":1489
 *         cdef shared_ptr[CDataType] struct_type
 * 
 *     if isinstance(fields, collections.Mapping):             # <<<<<<<<<<<<<<
 *         fields = fields.items()
 * 
 */
  }

  /* "pyarrow/types.pxi":1492
 *         fields = fields.items()
 * 
 *     for item in fields:             # <<<<<<<<<<<<<<
 *         if isinstance(item, tuple):
 *             py_field = field(*item)
 */
  if (likely(PyList_CheckExact(__pyx_v_fields)) || PyTuple_CheckExact(__pyx_v_fields)) {
    __pyx_t_2 = __pyx_v_fields; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_fields); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1492, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 1492, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(4, 1492, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1492, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(4, 1492, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1492, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_7(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(4, 1492, __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":1493
 * 
 *     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":1494
 *     for item in fields:
 *         if isinstance(item, tuple):
 *             py_field = field(*item)             # <<<<<<<<<<<<<<
 *         else:
 *             py_field = item
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_field); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1494, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_item); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1494, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1494, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(4, 1494, __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":1493
 * 
 *     for item in fields:
 *         if isinstance(item, tuple):             # <<<<<<<<<<<<<<
 *             py_field = field(*item)
 *         else:
 */
      goto __pyx_L6;
    }

    /* "pyarrow/types.pxi":1496
 *             py_field = field(*item)
 *         else:
 *             py_field = item             # <<<<<<<<<<<<<<
 *         c_fields.push_back(py_field.sp_field)
 * 
 */
    /*else*/ {
      if (!(likely(((__pyx_v_item) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_item, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(4, 1496, __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":1497
 *         else:
 *             py_field = item
 *         c_fields.push_back(py_field.sp_field)             # <<<<<<<<<<<<<<
 * 
 *     struct_type.reset(new CStructType(c_fields))
 */
    try {
      __pyx_v_c_fields.push_back(__pyx_v_py_field->sp_field);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(4, 1497, __pyx_L1_error)
    }

    /* "pyarrow/types.pxi":1492
 *         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":1499
 *         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":1500
 * 
 *     struct_type.reset(new CStructType(c_fields))
 *     return pyarrow_wrap_data_type(struct_type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_struct_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1455
 * 
 * 
 * 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":1503
 * 
 * 
 * def union(children_fields, mode):             # <<<<<<<<<<<<<<
 *     """
 *     Create UnionType from children fields.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_75union(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_74union[] = "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_75union = {"union", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_75union, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_74union};
static PyObject *__pyx_pw_7pyarrow_3lib_75union(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(4, 1503, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "union") < 0)) __PYX_ERR(4, 1503, __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(4, 1503, __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_74union(__pyx_self, __pyx_v_children_fields, __pyx_v_mode);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_74union(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":1524
 *         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":1525
 * 
 *     if isinstance(mode, int):
 *         if mode not in (_UnionMode_SPARSE, _UnionMode_DENSE):             # <<<<<<<<<<<<<<
 *             raise ValueError("Invalid union mode {0!r}".format(mode))
 *     else:
 */
    __Pyx_INCREF(__pyx_v_mode);
    __pyx_t_3 = __pyx_v_mode;
    __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_UnionMode_3a__3a_type( arrow::UnionMode::SPARSE); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1525, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1525, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1525, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_1) {
    } else {
      __pyx_t_2 = __pyx_t_1;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_UnionMode_3a__3a_type( arrow::UnionMode::DENSE); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1525, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1525, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1525, __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":1526
 *     if isinstance(mode, int):
 *         if mode not in (_UnionMode_SPARSE, _UnionMode_DENSE):
 *             raise ValueError("Invalid union mode {0!r}".format(mode))             # <<<<<<<<<<<<<<
 *     else:
 *         if mode == 'sparse':
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Invalid_union_mode_0_r, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1526, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_mode) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_mode);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1526, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1526, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(4, 1526, __pyx_L1_error)

      /* "pyarrow/types.pxi":1525
 * 
 *     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":1524
 *         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":1528
 *             raise ValueError("Invalid union mode {0!r}".format(mode))
 *     else:
 *         if mode == 'sparse':             # <<<<<<<<<<<<<<
 *             mode = _UnionMode_SPARSE
 *         elif mode == 'dense':
 */
  /*else*/ {
    __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_mode, __pyx_n_u_sparse, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1528, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "pyarrow/types.pxi":1529
 *     else:
 *         if mode == 'sparse':
 *             mode = _UnionMode_SPARSE             # <<<<<<<<<<<<<<
 *         elif mode == 'dense':
 *             mode = _UnionMode_DENSE
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_UnionMode_3a__3a_type( arrow::UnionMode::SPARSE); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1529, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_mode, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "pyarrow/types.pxi":1528
 *             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":1530
 *         if mode == 'sparse':
 *             mode = _UnionMode_SPARSE
 *         elif mode == 'dense':             # <<<<<<<<<<<<<<
 *             mode = _UnionMode_DENSE
 *         else:
 */
    __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_mode, __pyx_n_u_dense, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1530, __pyx_L1_error)
    if (likely(__pyx_t_1)) {

      /* "pyarrow/types.pxi":1531
 *             mode = _UnionMode_SPARSE
 *         elif mode == 'dense':
 *             mode = _UnionMode_DENSE             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError("Invalid union mode {0!r}".format(mode))
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_UnionMode_3a__3a_type( arrow::UnionMode::DENSE); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1531, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_mode, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "pyarrow/types.pxi":1530
 *         if mode == 'sparse':
 *             mode = _UnionMode_SPARSE
 *         elif mode == 'dense':             # <<<<<<<<<<<<<<
 *             mode = _UnionMode_DENSE
 *         else:
 */
      goto __pyx_L7;
    }

    /* "pyarrow/types.pxi":1533
 *             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_u_Invalid_union_mode_0_r, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1533, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_mode) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_mode);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1533, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1533, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(4, 1533, __pyx_L1_error)
    }
    __pyx_L7:;
  }
  __pyx_L3:;

  /* "pyarrow/types.pxi":1535
 *             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(4, 1535, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1535, __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(4, 1535, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1535, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(4, 1535, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1535, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_8(__pyx_t_3);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(4, 1535, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(4, 1535, __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":1536
 * 
 *     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(4, 1536, __pyx_L1_error)
    }

    /* "pyarrow/types.pxi":1537
 *     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(4, 1537, __pyx_L1_error)
    }

    /* "pyarrow/types.pxi":1535
 *             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":1539
 *         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(4, 1539, __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(4, 1539, __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(4, 1539, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_1) {

    /* "pyarrow/types.pxi":1540
 * 
 *     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":1539
 *         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":1543
 *                                         _UnionMode_SPARSE))
 *     else:
 *         union_type.reset(new CUnionType(c_fields, type_codes,             # <<<<<<<<<<<<<<
 *                                         _UnionMode_DENSE))
 * 
 */
  /*else*/ {

    /* "pyarrow/types.pxi":1544
 *     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":1546
 *                                         _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(4, 1546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1503
 * 
 * 
 * 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":1597
 * 
 * 
 * def type_for_alias(name):             # <<<<<<<<<<<<<<
 *     """
 *     Return DataType given a string alias if one exists
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_77type_for_alias(PyObject *__pyx_self, PyObject *__pyx_v_name); /*proto*/
static char __pyx_doc_7pyarrow_3lib_76type_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_77type_for_alias = {"type_for_alias", (PyCFunction)__pyx_pw_7pyarrow_3lib_77type_for_alias, METH_O, __pyx_doc_7pyarrow_3lib_76type_for_alias};
static PyObject *__pyx_pw_7pyarrow_3lib_77type_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_76type_for_alias(__pyx_self, ((PyObject *)__pyx_v_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_76type_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":1605
 *     type : DataType
 *     """
 *     name = name.lower()             # <<<<<<<<<<<<<<
 *     try:
 *         alias = _type_aliases[name]
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1605, __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, 1605, __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":1606
 *     """
 *     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":1607
 *     name = name.lower()
 *     try:
 *         alias = _type_aliases[name]             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError('No type alias for {0}'.format(name))
 */
      if (unlikely(__pyx_v_7pyarrow_3lib__type_aliases == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(4, 1607, __pyx_L3_error)
      }
      __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_7pyarrow_3lib__type_aliases, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1607, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_alias = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "pyarrow/types.pxi":1606
 *     """
 *     name = name.lower()
 *     try:             # <<<<<<<<<<<<<<
 *         alias = _type_aliases[name]
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pyarrow/types.pxi":1608
 *     try:
 *         alias = _type_aliases[name]
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError('No type alias for {0}'.format(name))
 * 
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pyarrow.lib.type_for_alias", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(4, 1608, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_3);

      /* "pyarrow/types.pxi":1609
 *         alias = _type_aliases[name]
 *     except KeyError:
 *         raise ValueError('No type alias for {0}'.format(name))             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(alias, DataType):
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_No_type_alias_for_0, __pyx_n_s_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 1609, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      __pyx_t_8 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_name);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1609, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 1609, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(4, 1609, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/types.pxi":1606
 *     """
 *     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":1611
 *         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":1612
 * 
 *     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":1611
 *         raise ValueError('No type alias for {0}'.format(name))
 * 
 *     if isinstance(alias, DataType):             # <<<<<<<<<<<<<<
 *         return alias
 *     return alias()
 */
  }

  /* "pyarrow/types.pxi":1613
 *     if isinstance(alias, DataType):
 *         return alias
 *     return alias()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_alias);
  __pyx_t_2 = __pyx_v_alias; __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1613, __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":1597
 * 
 * 
 * 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":1616
 * 
 * 
 * cdef DataType ensure_type(object ty, c_bool allow_none=False):             # <<<<<<<<<<<<<<
 *     if allow_none and ty is None:
 *         return None
 */

static struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_f_7pyarrow_3lib_ensure_type(PyObject *__pyx_v_ty, struct __pyx_opt_args_7pyarrow_3lib_ensure_type *__pyx_optional_args) {
  bool __pyx_v_allow_none = ((bool)0);
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("ensure_type", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_allow_none = __pyx_optional_args->allow_none;
    }
  }

  /* "pyarrow/types.pxi":1617
 * 
 * cdef DataType ensure_type(object ty, c_bool allow_none=False):
 *     if allow_none and ty is None:             # <<<<<<<<<<<<<<
 *         return None
 *     elif isinstance(ty, DataType):
 */
  __pyx_t_2 = (__pyx_v_allow_none != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_ty == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pyarrow/types.pxi":1618
 * cdef DataType ensure_type(object ty, c_bool allow_none=False):
 *     if allow_none and ty is None:
 *         return None             # <<<<<<<<<<<<<<
 *     elif isinstance(ty, DataType):
 *         return ty
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_r = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1617
 * 
 * cdef DataType ensure_type(object ty, c_bool allow_none=False):
 *     if allow_none and ty is None:             # <<<<<<<<<<<<<<
 *         return None
 *     elif isinstance(ty, DataType):
 */
  }

  /* "pyarrow/types.pxi":1619
 *     if allow_none and ty is None:
 *         return None
 *     elif isinstance(ty, DataType):             # <<<<<<<<<<<<<<
 *         return ty
 *     elif isinstance(ty, six.string_types):
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_ty, __pyx_ptype_7pyarrow_3lib_DataType); 
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/types.pxi":1620
 *         return None
 *     elif isinstance(ty, DataType):
 *         return ty             # <<<<<<<<<<<<<<
 *     elif isinstance(ty, six.string_types):
 *         return type_for_alias(ty)
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    if (!(likely(((__pyx_v_ty) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_ty, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(4, 1620, __pyx_L1_error)
    __Pyx_INCREF(__pyx_v_ty);
    __pyx_r = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_ty);
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1619
 *     if allow_none and ty is None:
 *         return None
 *     elif isinstance(ty, DataType):             # <<<<<<<<<<<<<<
 *         return ty
 *     elif isinstance(ty, six.string_types):
 */
  }

  /* "pyarrow/types.pxi":1621
 *     elif isinstance(ty, DataType):
 *         return ty
 *     elif isinstance(ty, six.string_types):             # <<<<<<<<<<<<<<
 *         return type_for_alias(ty)
 *     else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_six); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_string_types); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_ty, __pyx_t_5); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 1621, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_1 = (__pyx_t_3 != 0);
  if (likely(__pyx_t_1)) {

    /* "pyarrow/types.pxi":1622
 *         return ty
 *     elif isinstance(ty, six.string_types):
 *         return type_for_alias(ty)             # <<<<<<<<<<<<<<
 *     else:
 *         raise TypeError('DataType expected, got {!r}'.format(type(ty)))
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_type_for_alias); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1622, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_v_ty) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_ty);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1622, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(4, 1622, __pyx_L1_error)
    __pyx_r = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1621
 *     elif isinstance(ty, DataType):
 *         return ty
 *     elif isinstance(ty, six.string_types):             # <<<<<<<<<<<<<<
 *         return type_for_alias(ty)
 *     else:
 */
  }

  /* "pyarrow/types.pxi":1624
 *         return type_for_alias(ty)
 *     else:
 *         raise TypeError('DataType expected, got {!r}'.format(type(ty)))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_DataType_expected_got_r, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1624, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, ((PyObject *)Py_TYPE(__pyx_v_ty))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)Py_TYPE(__pyx_v_ty)));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1624, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1624, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(4, 1624, __pyx_L1_error)
  }

  /* "pyarrow/types.pxi":1616
 * 
 * 
 * cdef DataType ensure_type(object ty, c_bool allow_none=False):             # <<<<<<<<<<<<<<
 *     if allow_none and ty is None:
 *         return None
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.ensure_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1627
 * 
 * 
 * def schema(fields, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct pyarrow.Schema from collection of fields
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_79schema(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_78schema[] = "schema(fields, metadata=None)\n\n    Construct pyarrow.Schema from collection of fields\n\n    Parameters\n    ----------\n    field : iterable of Fields or tuples, or mapping of strings to DataTypes\n    metadata : dict, default None\n        Keys and values must be coercible to bytes\n\n    Examples\n    --------\n    ::\n\n        import pyarrow as pa\n        fields = [\n            ('some_int', pa.int32()),\n            ('some_string', pa.string()),\n        ]\n        schema = pa.schema(fields)\n\n    Returns\n    -------\n    schema : pyarrow.Schema\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_79schema = {"schema", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_79schema, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_78schema};
static PyObject *__pyx_pw_7pyarrow_3lib_79schema(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fields = 0;
  PyObject *__pyx_v_metadata = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("schema (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fields,&__pyx_n_s_metadata,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fields)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_metadata);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "schema") < 0)) __PYX_ERR(4, 1627, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_fields = values[0];
    __pyx_v_metadata = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("schema", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 1627, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.schema", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_78schema(__pyx_self, __pyx_v_fields, __pyx_v_metadata);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_78schema(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fields, PyObject *__pyx_v_metadata) {
  std::shared_ptr< arrow::KeyValueMetadata>  __pyx_v_c_meta;
  std::shared_ptr< arrow::Schema>  __pyx_v_c_schema;
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_result = 0;
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_py_field = 0;
  std::vector<std::shared_ptr< arrow::Field> >  __pyx_v_c_fields;
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("schema", 0);
  __Pyx_INCREF(__pyx_v_fields);

  /* "pyarrow/types.pxi":1659
 *         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(4, 1659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Mapping); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_fields, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 1659, __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":1660
 * 
 *     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(4, 1660, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1660, __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":1659
 *         vector[shared_ptr[CField]] c_fields
 * 
 *     if isinstance(fields, collections.Mapping):             # <<<<<<<<<<<<<<
 *         fields = fields.items()
 * 
 */
  }

  /* "pyarrow/types.pxi":1662
 *         fields = fields.items()
 * 
 *     for item in fields:             # <<<<<<<<<<<<<<
 *         if isinstance(item, tuple):
 *             py_field = field(*item)
 */
  if (likely(PyList_CheckExact(__pyx_v_fields)) || PyTuple_CheckExact(__pyx_v_fields)) {
    __pyx_t_2 = __pyx_v_fields; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_fields); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 1662, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(4, 1662, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1662, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(4, 1662, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1662, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_7(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(4, 1662, __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":1663
 * 
 *     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":1664
 *     for item in fields:
 *         if isinstance(item, tuple):
 *             py_field = field(*item)             # <<<<<<<<<<<<<<
 *         else:
 *             py_field = item
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_field); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1664, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_item); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1664, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1664, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(4, 1664, __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":1663
 * 
 *     for item in fields:
 *         if isinstance(item, tuple):             # <<<<<<<<<<<<<<
 *             py_field = field(*item)
 *         else:
 */
      goto __pyx_L6;
    }

    /* "pyarrow/types.pxi":1666
 *             py_field = field(*item)
 *         else:
 *             py_field = item             # <<<<<<<<<<<<<<
 *         if py_field is None:
 *             raise TypeError("field or tuple expected, got None")
 */
    /*else*/ {
      if (!(likely(((__pyx_v_item) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_item, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(4, 1666, __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":1667
 *         else:
 *             py_field = item
 *         if py_field is None:             # <<<<<<<<<<<<<<
 *             raise TypeError("field or tuple expected, got None")
 *         c_fields.push_back(py_field.sp_field)
 */
    __pyx_t_3 = (((PyObject *)__pyx_v_py_field) == Py_None);
    __pyx_t_4 = (__pyx_t_3 != 0);
    if (unlikely(__pyx_t_4)) {

      /* "pyarrow/types.pxi":1668
 *             py_field = item
 *         if py_field is None:
 *             raise TypeError("field or tuple expected, got None")             # <<<<<<<<<<<<<<
 *         c_fields.push_back(py_field.sp_field)
 * 
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1668, __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, 1668, __pyx_L1_error)

      /* "pyarrow/types.pxi":1667
 *         else:
 *             py_field = item
 *         if py_field is None:             # <<<<<<<<<<<<<<
 *             raise TypeError("field or tuple expected, got None")
 *         c_fields.push_back(py_field.sp_field)
 */
    }

    /* "pyarrow/types.pxi":1669
 *         if py_field is None:
 *             raise TypeError("field or tuple expected, got None")
 *         c_fields.push_back(py_field.sp_field)             # <<<<<<<<<<<<<<
 * 
 *     if metadata is not None:
 */
    try {
      __pyx_v_c_fields.push_back(__pyx_v_py_field->sp_field);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(4, 1669, __pyx_L1_error)
    }

    /* "pyarrow/types.pxi":1662
 *         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":1671
 *         c_fields.push_back(py_field.sp_field)
 * 
 *     if metadata is not None:             # <<<<<<<<<<<<<<
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')
 */
  __pyx_t_4 = (__pyx_v_metadata != Py_None);
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/types.pxi":1672
 * 
 *     if metadata is not None:
 *         if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *             raise TypeError('Metadata must be an instance of dict')
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 */
    __pyx_t_3 = PyDict_Check(__pyx_v_metadata); 
    __pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0);
    if (unlikely(__pyx_t_4)) {

      /* "pyarrow/types.pxi":1673
 *     if metadata is not None:
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')             # <<<<<<<<<<<<<<
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1673, __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, 1673, __pyx_L1_error)

      /* "pyarrow/types.pxi":1672
 * 
 *     if metadata is not None:
 *         if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *             raise TypeError('Metadata must be an instance of dict')
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 */
    }

    /* "pyarrow/types.pxi":1674
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')
 *         c_meta = pyarrow_unwrap_metadata(metadata)             # <<<<<<<<<<<<<<
 * 
 *     c_schema.reset(new CSchema(c_fields, c_meta))
 */
    __pyx_v_c_meta = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_metadata(__pyx_v_metadata);

    /* "pyarrow/types.pxi":1671
 *         c_fields.push_back(py_field.sp_field)
 * 
 *     if metadata is not None:             # <<<<<<<<<<<<<<
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')
 */
  }

  /* "pyarrow/types.pxi":1676
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 *     c_schema.reset(new CSchema(c_fields, c_meta))             # <<<<<<<<<<<<<<
 *     result = Schema.__new__(Schema)
 *     result.init_schema(c_schema)
 */
  __pyx_v_c_schema.reset(new  arrow::Schema(__pyx_v_c_fields, __pyx_v_c_meta));

  /* "pyarrow/types.pxi":1677
 * 
 *     c_schema.reset(new CSchema(c_fields, c_meta))
 *     result = Schema.__new__(Schema)             # <<<<<<<<<<<<<<
 *     result.init_schema(c_schema)
 * 
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_Schema(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_Schema), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1677, __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":1678
 *     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":1680
 *     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":1627
 * 
 * 
 * def schema(fields, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct pyarrow.Schema from collection of fields
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.schema", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF((PyObject *)__pyx_v_py_field);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XDECREF(__pyx_v_fields);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1683
 * 
 * 
 * def from_numpy_dtype(object dtype):             # <<<<<<<<<<<<<<
 *     """
 *     Convert NumPy dtype to pyarrow.DataType
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_81from_numpy_dtype(PyObject *__pyx_self, PyObject *__pyx_v_dtype); /*proto*/
static char __pyx_doc_7pyarrow_3lib_80from_numpy_dtype[] = "from_numpy_dtype(dtype)\n\n    Convert NumPy dtype to pyarrow.DataType\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_81from_numpy_dtype = {"from_numpy_dtype", (PyCFunction)__pyx_pw_7pyarrow_3lib_81from_numpy_dtype, METH_O, __pyx_doc_7pyarrow_3lib_80from_numpy_dtype};
static PyObject *__pyx_pw_7pyarrow_3lib_81from_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_80from_numpy_dtype(__pyx_self, ((PyObject *)__pyx_v_dtype));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_80from_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":1688
 *     """
 *     cdef shared_ptr[CDataType] c_type
 *     dtype = np.dtype(dtype)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         check_status(NumPyDtypeToArrow(dtype, &c_type))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_dtype);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1688, __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":1689
 *     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":1690
 *     dtype = np.dtype(dtype)
 *     with nogil:
 *         check_status(NumPyDtypeToArrow(dtype, &c_type))             # <<<<<<<<<<<<<<
 * 
 *     return pyarrow_wrap_data_type(c_type)
 */
        __pyx_t_4 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::NumPyDtypeToArrow(__pyx_v_dtype, (&__pyx_v_c_type))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(4, 1690, __pyx_L4_error)
      }

      /* "pyarrow/types.pxi":1689
 *     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":1692
 *         check_status(NumPyDtypeToArrow(dtype, &c_type))
 * 
 *     return pyarrow_wrap_data_type(c_type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_c_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1683
 * 
 * 
 * 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":1695
 * 
 * 
 * def is_boolean_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyBool(obj)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_83is_boolean_value(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_82is_boolean_value[] = "is_boolean_value(obj)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_83is_boolean_value = {"is_boolean_value", (PyCFunction)__pyx_pw_7pyarrow_3lib_83is_boolean_value, METH_O, __pyx_doc_7pyarrow_3lib_82is_boolean_value};
static PyObject *__pyx_pw_7pyarrow_3lib_83is_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_82is_boolean_value(__pyx_self, ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_82is_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":1696
 * 
 * def is_boolean_value(object obj):
 *     return IsPyBool(obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(arrow::py::IsPyBool(__pyx_v_obj)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1695
 * 
 * 
 * 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":1699
 * 
 * 
 * def is_integer_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyInt(obj)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_85is_integer_value(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_84is_integer_value[] = "is_integer_value(obj)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_85is_integer_value = {"is_integer_value", (PyCFunction)__pyx_pw_7pyarrow_3lib_85is_integer_value, METH_O, __pyx_doc_7pyarrow_3lib_84is_integer_value};
static PyObject *__pyx_pw_7pyarrow_3lib_85is_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_84is_integer_value(__pyx_self, ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_84is_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":1700
 * 
 * def is_integer_value(object obj):
 *     return IsPyInt(obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(arrow::py::IsPyInt(__pyx_v_obj)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1699
 * 
 * 
 * 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":1703
 * 
 * 
 * def is_float_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyFloat(obj)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_87is_float_value(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_86is_float_value[] = "is_float_value(obj)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_87is_float_value = {"is_float_value", (PyCFunction)__pyx_pw_7pyarrow_3lib_87is_float_value, METH_O, __pyx_doc_7pyarrow_3lib_86is_float_value};
static PyObject *__pyx_pw_7pyarrow_3lib_87is_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_86is_float_value(__pyx_self, ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_86is_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":1704
 * 
 * def is_float_value(object obj):
 *     return IsPyFloat(obj)             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(arrow::py::IsPyFloat(__pyx_v_obj)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1703
 * 
 * 
 * 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/lib.pxd":124
 * cdef class Scalar:
 *     cdef readonly:
 *         DataType type             # <<<<<<<<<<<<<<
 * 
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Scalar_4type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Scalar_4type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Scalar_4type___get__(((struct __pyx_obj_7pyarrow_3lib_Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Scalar_4type___get__(struct __pyx_obj_7pyarrow_3lib_Scalar *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->type));
  __pyx_r = ((PyObject *)__pyx_v_self->type);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Scalar_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Scalar___reduce_cython__[] = "Scalar.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_6Scalar_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Scalar___reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Scalar___reduce_cython__(struct __pyx_obj_7pyarrow_3lib_Scalar *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.type,)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->type));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->type));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->type));
  __pyx_v_state = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.type,)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = (self.type,)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_2 = (__pyx_v__dict != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.type is not None
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.type,)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.type is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_Scalar, (type(self), 0x599dcce, None), state
 */
  /*else*/ {
    __pyx_t_3 = (((PyObject *)__pyx_v_self->type) != Py_None);
    __pyx_v_use_setstate = __pyx_t_3;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.type is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_Scalar, (type(self), 0x599dcce, None), state
 *     else:
 */
  __pyx_t_3 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_3) {

    /* "(tree fragment)":13
 *         use_setstate = self.type is not None
 *     if use_setstate:
 *         return __pyx_unpickle_Scalar, (type(self), 0x599dcce, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_Scalar, (type(self), 0x599dcce, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Scalar); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_93969614);
    __Pyx_GIVEREF(__pyx_int_93969614);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_93969614);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.type is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_Scalar, (type(self), 0x599dcce, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_Scalar, (type(self), 0x599dcce, None), state
 *     else:
 *         return __pyx_unpickle_Scalar, (type(self), 0x599dcce, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Scalar__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Scalar); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_93969614);
    __Pyx_GIVEREF(__pyx_int_93969614);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_93969614);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.Scalar.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Scalar, (type(self), 0x599dcce, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Scalar__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Scalar_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Scalar_2__setstate_cython__[] = "Scalar.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_6Scalar_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Scalar_2__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_Scalar *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Scalar_2__setstate_cython__(struct __pyx_obj_7pyarrow_3lib_Scalar *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_Scalar, (type(self), 0x599dcce, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Scalar__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(9, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_7pyarrow_3lib___pyx_unpickle_Scalar__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Scalar, (type(self), 0x599dcce, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Scalar__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Scalar.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":33
 *     """
 *     # TODO rename this NullValue?
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         global NA
 *         if NA is not None:
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_8NullType_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_8NullType_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_8NullType___cinit__(((struct __pyx_obj_7pyarrow_3lib_NullType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_8NullType___cinit__(struct __pyx_obj_7pyarrow_3lib_NullType *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/scalar.pxi":35
 *     def __cinit__(self):
 *         global NA
 *         if NA is not None:             # <<<<<<<<<<<<<<
 *             raise Exception('Cannot create multiple NAType instances')
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NA); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (unlikely(__pyx_t_3)) {

    /* "pyarrow/scalar.pxi":36
 *         global NA
 *         if NA is not None:
 *             raise Exception('Cannot create multiple NAType instances')             # <<<<<<<<<<<<<<
 * 
 *         self.type = null()
 */
    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 36, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(5, 36, __pyx_L1_error)

    /* "pyarrow/scalar.pxi":35
 *     def __cinit__(self):
 *         global NA
 *         if NA is not None:             # <<<<<<<<<<<<<<
 *             raise Exception('Cannot create multiple NAType instances')
 * 
 */
  }

  /* "pyarrow/scalar.pxi":38
 *             raise Exception('Cannot create multiple NAType instances')
 * 
 *         self.type = null()             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_null); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(5, 38, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.type);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.type));
  __pyx_v_self->__pyx_base.type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":33
 *     """
 *     # TODO rename this NullValue?
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         global NA
 *         if NA is not None:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.NullType.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":40
 *         self.type = null()
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return 'NULL'
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8NullType_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_8NullType_3__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8NullType_2__repr__(((struct __pyx_obj_7pyarrow_3lib_NullType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8NullType_2__repr__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NullType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/scalar.pxi":41
 * 
 *     def __repr__(self):
 *         return 'NULL'             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_n_u_NULL);
  __pyx_r = __pyx_n_u_NULL;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":40
 *         self.type = null()
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return 'NULL'
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":43
 *         return 'NULL'
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return None
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8NullType_5as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_8NullType_4as_py[] = "NullType.as_py(self)\n\n        Return None\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_8NullType_5as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8NullType_4as_py(((struct __pyx_obj_7pyarrow_3lib_NullType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8NullType_4as_py(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NullType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":47
 *         Return None
 *         """
 *         return None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":43
 *         return 'NULL'
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return None
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(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__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__30, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":58
 *     """
 * 
 *     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":61
 *         raise TypeError("Do not call {}'s constructor directly, use array "
 *                         "subscription instead."
 *                         .format(self.__class__.__name__))             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, DataType type, const shared_ptr[CArray]& sp_array,
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Do_not_call_s_constructor_direct_5, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 61, __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, 61, __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, 61, __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, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/scalar.pxi":59
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call {}'s constructor directly, use array "             # <<<<<<<<<<<<<<
 *                         "subscription instead."
 *                         .format(self.__class__.__name__))
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 59, __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, 59, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":58
 *     """
 * 
 *     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":63
 *                         .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":65
 *     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":66
 *                    int64_t index):
 *         self.type = type
 *         self.index = index             # <<<<<<<<<<<<<<
 *         self._set_array(sp_array)
 * 
 */
  __pyx_v_self->index = __pyx_v_index;

  /* "pyarrow/scalar.pxi":67
 *         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":63
 *                         .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":69
 *         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":70
 * 
 *     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":69
 *         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":72
 *         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":73
 * 
 *     def __repr__(self):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             return repr(self.as_py())
 *         else:
 */
  __pyx_t_1 = __Pyx_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_u_as_py); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 73, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/scalar.pxi":74
 *     def __repr__(self):
 *         if hasattr(self, 'as_py'):
 *             return repr(self.as_py())             # <<<<<<<<<<<<<<
 *         else:
 *             return super(Scalar, self).__repr__()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_as_py); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 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(5, 74, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Repr(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 74, __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":73
 * 
 *     def __repr__(self):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             return repr(self.as_py())
 *         else:
 */
  }

  /* "pyarrow/scalar.pxi":76
 *             return repr(self.as_py())
 *         else:
 *             return super(Scalar, self).__repr__()             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 76, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self));
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 76, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_repr); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 76, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 76, __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":72
 *         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":78
 *             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":79
 * 
 *     def __str__(self):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             return str(self.as_py())
 *         else:
 */
  __pyx_t_1 = __Pyx_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_u_as_py); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 79, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/scalar.pxi":80
 *     def __str__(self):
 *         if hasattr(self, 'as_py'):
 *             return str(self.as_py())             # <<<<<<<<<<<<<<
 *         else:
 *             return super(Scalar, self).__str__()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_as_py); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 80, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 80, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 80, __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":79
 * 
 *     def __str__(self):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             return str(self.as_py())
 *         else:
 */
  }

  /* "pyarrow/scalar.pxi":82
 *             return str(self.as_py())
 *         else:
 *             return super(Scalar, self).__str__()             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 82, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self));
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 82, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 82, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 82, __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":78
 *             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":84
 *             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":85
 * 
 *     def __eq__(self, other):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             if isinstance(other, ArrayValue):
 *                 other = other.as_py()
 */
  __pyx_t_1 = __Pyx_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_u_as_py); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 85, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (likely(__pyx_t_2)) {

    /* "pyarrow/scalar.pxi":86
 *     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":87
 *         if hasattr(self, 'as_py'):
 *             if isinstance(other, ArrayValue):
 *                 other = other.as_py()             # <<<<<<<<<<<<<<
 *             return self.as_py() == other
 *         else:
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_as_py); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 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_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 87, __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":86
 *     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":88
 *             if isinstance(other, ArrayValue):
 *                 other = other.as_py()
 *             return self.as_py() == other             # <<<<<<<<<<<<<<
 *         else:
 *             raise NotImplementedError(
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_as_py); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 88, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 88, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_other, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 88, __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":85
 * 
 *     def __eq__(self, other):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             if isinstance(other, ArrayValue):
 *                 other = other.as_py()
 */
  }

  /* "pyarrow/scalar.pxi":90
 *             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__31, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 90, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(5, 90, __pyx_L1_error)
  }

  /* "pyarrow/scalar.pxi":84
 *             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":93
 *                 "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":94
 * 
 *     def __hash__(self):
 *         return hash(self.as_py())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_as_py); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 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(5, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_4 == ((Py_hash_t)-1))) __PYX_ERR(5, 94, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":93
 *                 "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__32, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__33, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":102
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python bool.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12BooleanValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12BooleanValue_as_py[] = "BooleanValue.as_py(self)\n\n        Return this value as a Python bool.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12BooleanValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12BooleanValue_as_py(((struct __pyx_obj_7pyarrow_3lib_BooleanValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12BooleanValue_as_py(struct __pyx_obj_7pyarrow_3lib_BooleanValue *__pyx_v_self) {
   arrow::BooleanArray *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":106
 *         Return this value as a Python bool.
 *         """
 *         cdef CBooleanArray* ap = <CBooleanArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_ap = (( arrow::BooleanArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":107
 *         """
 *         cdef CBooleanArray* ap = <CBooleanArray*> self.sp_array.get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":102
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python bool.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BooleanValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12BooleanValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12BooleanValue_2__reduce_cython__[] = "BooleanValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_12BooleanValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12BooleanValue_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_BooleanValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12BooleanValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BooleanValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__35, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":115
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9Int8Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9Int8Value_as_py[] = "Int8Value.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_9Int8Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9Int8Value_as_py(((struct __pyx_obj_7pyarrow_3lib_Int8Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_9Int8Value_as_py(struct __pyx_obj_7pyarrow_3lib_Int8Value *__pyx_v_self) {
   arrow::Int8Array *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":119
 *         Return this value as a Python int.
 *         """
 *         cdef CInt8Array* ap = <CInt8Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_ap = (( arrow::Int8Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":120
 *         """
 *         cdef CInt8Array* ap = <CInt8Array*> self.sp_array.get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int8_t(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":115
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int8Value.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9Int8Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9Int8Value_2__reduce_cython__[] = "Int8Value.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_9Int8Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9Int8Value_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Int8Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_9Int8Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int8Value *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__37, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":128
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10UInt8Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10UInt8Value_as_py[] = "UInt8Value.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10UInt8Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10UInt8Value_as_py(((struct __pyx_obj_7pyarrow_3lib_UInt8Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10UInt8Value_as_py(struct __pyx_obj_7pyarrow_3lib_UInt8Value *__pyx_v_self) {
   arrow::UInt8Array *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":132
 *         Return this value as a Python int.
 *         """
 *         cdef CUInt8Array* ap = <CUInt8Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_ap = (( arrow::UInt8Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":133
 *         """
 *         cdef CUInt8Array* ap = <CUInt8Array*> self.sp_array.get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":128
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt8Value.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10UInt8Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10UInt8Value_2__reduce_cython__[] = "UInt8Value.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10UInt8Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10UInt8Value_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt8Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10UInt8Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt8Value *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__39, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":141
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Int16Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10Int16Value_as_py[] = "Int16Value.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10Int16Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Int16Value_as_py(((struct __pyx_obj_7pyarrow_3lib_Int16Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10Int16Value_as_py(struct __pyx_obj_7pyarrow_3lib_Int16Value *__pyx_v_self) {
   arrow::Int16Array *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":145
 *         Return this value as a Python int.
 *         """
 *         cdef CInt16Array* ap = <CInt16Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_ap = (( arrow::Int16Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":146
 *         """
 *         cdef CInt16Array* ap = <CInt16Array*> self.sp_array.get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int16_t(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":141
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int16Value.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Int16Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10Int16Value_2__reduce_cython__[] = "Int16Value.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10Int16Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Int16Value_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Int16Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10Int16Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int16Value *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__41, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":154
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt16Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11UInt16Value_as_py[] = "UInt16Value.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt16Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11UInt16Value_as_py(((struct __pyx_obj_7pyarrow_3lib_UInt16Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11UInt16Value_as_py(struct __pyx_obj_7pyarrow_3lib_UInt16Value *__pyx_v_self) {
   arrow::UInt16Array *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":158
 *         Return this value as a Python int.
 *         """
 *         cdef CUInt16Array* ap = <CUInt16Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_ap = (( arrow::UInt16Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":159
 *         """
 *         cdef CUInt16Array* ap = <CUInt16Array*> self.sp_array.get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_uint16_t(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":154
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt16Value.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt16Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11UInt16Value_2__reduce_cython__[] = "UInt16Value.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt16Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11UInt16Value_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt16Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11UInt16Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt16Value *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__43, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":167
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Int32Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10Int32Value_as_py[] = "Int32Value.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10Int32Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Int32Value_as_py(((struct __pyx_obj_7pyarrow_3lib_Int32Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10Int32Value_as_py(struct __pyx_obj_7pyarrow_3lib_Int32Value *__pyx_v_self) {
   arrow::Int32Array *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":171
 *         Return this value as a Python int.
 *         """
 *         cdef CInt32Array* ap = <CInt32Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_ap = (( arrow::Int32Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":172
 *         """
 *         cdef CInt32Array* ap = <CInt32Array*> self.sp_array.get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":167
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int32Value.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Int32Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10Int32Value_2__reduce_cython__[] = "Int32Value.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10Int32Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Int32Value_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Int32Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10Int32Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int32Value *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__45, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":180
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt32Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11UInt32Value_as_py[] = "UInt32Value.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt32Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11UInt32Value_as_py(((struct __pyx_obj_7pyarrow_3lib_UInt32Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11UInt32Value_as_py(struct __pyx_obj_7pyarrow_3lib_UInt32Value *__pyx_v_self) {
   arrow::UInt32Array *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":184
 *         Return this value as a Python int.
 *         """
 *         cdef CUInt32Array* ap = <CUInt32Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_ap = (( arrow::UInt32Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":185
 *         """
 *         cdef CUInt32Array* ap = <CUInt32Array*> self.sp_array.get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":180
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt32Value.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt32Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11UInt32Value_2__reduce_cython__[] = "UInt32Value.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt32Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11UInt32Value_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt32Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11UInt32Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt32Value *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__47, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":193
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Int64Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10Int64Value_as_py[] = "Int64Value.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10Int64Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Int64Value_as_py(((struct __pyx_obj_7pyarrow_3lib_Int64Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10Int64Value_as_py(struct __pyx_obj_7pyarrow_3lib_Int64Value *__pyx_v_self) {
   arrow::Int64Array *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":197
 *         Return this value as a Python int.
 *         """
 *         cdef CInt64Array* ap = <CInt64Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_ap = (( arrow::Int64Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":198
 *         """
 *         cdef CInt64Array* ap = <CInt64Array*> self.sp_array.get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":193
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int64Value.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Int64Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10Int64Value_2__reduce_cython__[] = "Int64Value.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10Int64Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Int64Value_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Int64Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10Int64Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int64Value *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__49, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":206
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt64Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11UInt64Value_as_py[] = "UInt64Value.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt64Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11UInt64Value_as_py(((struct __pyx_obj_7pyarrow_3lib_UInt64Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11UInt64Value_as_py(struct __pyx_obj_7pyarrow_3lib_UInt64Value *__pyx_v_self) {
   arrow::UInt64Array *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":210
 *         Return this value as a Python int.
 *         """
 *         cdef CUInt64Array* ap = <CUInt64Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_ap = (( arrow::UInt64Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":211
 *         """
 *         cdef CUInt64Array* ap = <CUInt64Array*> self.sp_array.get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":206
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt64Value.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt64Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11UInt64Value_2__reduce_cython__[] = "UInt64Value.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt64Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11UInt64Value_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt64Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11UInt64Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt64Value *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__51, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":219
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python datetime.datetime instance.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Date32Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Date32Value_as_py[] = "Date32Value.as_py(self)\n\n        Return this value as a Python datetime.datetime instance.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11Date32Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Date32Value_as_py(((struct __pyx_obj_7pyarrow_3lib_Date32Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Date32Value_as_py(struct __pyx_obj_7pyarrow_3lib_Date32Value *__pyx_v_self) {
   arrow::Date32Array *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":223
 *         Return this value as a Python datetime.datetime instance.
 *         """
 *         cdef CDate32Array* ap = <CDate32Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 * 
 *         # Shift to seconds since epoch
 */
  __pyx_v_ap = (( arrow::Date32Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":226
 * 
 *         # Shift to seconds since epoch
 *         return datetime.datetime.utcfromtimestamp(             # <<<<<<<<<<<<<<
 *             int(ap.Value(self.index)) * 86400).date()
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/scalar.pxi":227
 *         # 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(5, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "pyarrow/scalar.pxi":226
 * 
 *         # 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(5, 226, __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(5, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/scalar.pxi":227
 *         # 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(5, 227, __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(5, 227, __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(5, 227, __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(5, 226, __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(5, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 227, __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":219
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python datetime.datetime instance.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_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__52, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__53, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":235
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python datetime.datetime instance.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Date64Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Date64Value_as_py[] = "Date64Value.as_py(self)\n\n        Return this value as a Python datetime.datetime instance.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11Date64Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Date64Value_as_py(((struct __pyx_obj_7pyarrow_3lib_Date64Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Date64Value_as_py(struct __pyx_obj_7pyarrow_3lib_Date64Value *__pyx_v_self) {
   arrow::Date64Array *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":239
 *         Return this value as a Python datetime.datetime instance.
 *         """
 *         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":240
 *         """
 *         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":241
 *         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(5, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "pyarrow/scalar.pxi":240
 *         """
 *         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(5, 240, __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(5, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/scalar.pxi":241
 *         cdef CDate64Array* ap = <CDate64Array*> self.sp_array.get()
 *         return datetime.datetime.utcfromtimestamp(
 *             ap.Value(self.index) / 1000).date()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = PyFloat_FromDouble((((double)__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)) / 1000.0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 241, __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(5, 240, __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(5, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 241, __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":235
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python datetime.datetime instance.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_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__54, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__55, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":249
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python datetime.timedelta instance.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Time32Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Time32Value_as_py[] = "Time32Value.as_py(self)\n\n        Return this value as a Python datetime.timedelta instance.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11Time32Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Time32Value_as_py(((struct __pyx_obj_7pyarrow_3lib_Time32Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Time32Value_as_py(struct __pyx_obj_7pyarrow_3lib_Time32Value *__pyx_v_self) {
   arrow::Time32Array *__pyx_v_ap;
   arrow::Time32Type *__pyx_v_dtype;
  PyObject *__pyx_v_delta = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":254
 *         """
 *         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":255
 *         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":257
 *             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":258
 * 
 *         if dtype.unit() == TimeUnit_SECOND:
 *             delta = datetime.timedelta(seconds=ap.Value(self.index))             # <<<<<<<<<<<<<<
 *             return (datetime.datetime(1970, 1, 1) + delta).time()
 *         else:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_seconds, __pyx_t_4) < 0) __PYX_ERR(5, 258, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 258, __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":259
 *         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(5, 259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 259, __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__56, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_delta); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 259, __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":257
 *             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":261
 *             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(5, 261, __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(5, 261, __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(5, 261, __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(5, 261, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_milliseconds, __pyx_t_3) < 0) __PYX_ERR(5, 261, __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(5, 261, __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":262
 *         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(5, 262, __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(5, 262, __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__56, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 262, __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(5, 262, __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(5, 262, __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(5, 262, __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":249
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python datetime.timedelta instance.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.Time32Value.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_delta);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Time32Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Time32Value_2__reduce_cython__[] = "Time32Value.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Time32Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Time32Value_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Time32Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Time32Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Time32Value *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__58, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":270
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python datetime.timedelta instance.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Time64Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Time64Value_as_py[] = "Time64Value.as_py(self)\n\n        Return this value as a Python datetime.timedelta instance.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11Time64Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Time64Value_as_py(((struct __pyx_obj_7pyarrow_3lib_Time64Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Time64Value_as_py(struct __pyx_obj_7pyarrow_3lib_Time64Value *__pyx_v_self) {
   arrow::Time64Array *__pyx_v_ap;
   arrow::Time64Type *__pyx_v_dtype;
  int64_t __pyx_v_val;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":275
 *         """
 *         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":276
 *         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":278
 *             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":279
 * 
 *         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":280
 *         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":281
 *         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(5, 280, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "pyarrow/scalar.pxi":280
 *         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(5, 280, __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__56, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 280, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/scalar.pxi":281
 *         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(5, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 281, __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(5, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_microseconds, __pyx_t_6) < 0) __PYX_ERR(5, 281, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 281, __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":280
 *         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(5, 280, __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":281
 *         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(5, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 281, __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":279
 * 
 *         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":283
 *                     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":284
 *         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(5, 283, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);

    /* "pyarrow/scalar.pxi":283
 *                     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(5, 283, __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__56, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 283, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/scalar.pxi":284
 *         else:
 *             return (datetime.datetime(1970, 1, 1) +
 *                     datetime.timedelta(microseconds=val / 1000)).time()             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 284, __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(5, 284, __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(5, 284, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyFloat_FromDouble((((double)__pyx_v_val) / 1000.0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 284, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_microseconds, __pyx_t_5) < 0) __PYX_ERR(5, 284, __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(5, 284, __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":283
 *                     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(5, 283, __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":284
 *         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(5, 284, __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(5, 284, __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":270
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python datetime.timedelta instance.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.Time64Value.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Time64Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Time64Value_2__reduce_cython__[] = "Time64Value.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Time64Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Time64Value_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Time64Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Time64Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Time64Value *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__60, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":299
 *     except ImportError:
 *         _DATETIME_CONVERSION_FUNCTIONS.update({
 *             TimeUnit_SECOND: lambda x, tzinfo: (             # <<<<<<<<<<<<<<
 *                 datetime.datetime.utcfromtimestamp(x).replace(tzinfo=tzinfo)
 *             ),
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_30_datetime_conversion_functions_lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7pyarrow_3lib_30_datetime_conversion_functions_lambda = {"lambda", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_30_datetime_conversion_functions_lambda, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7pyarrow_3lib_30_datetime_conversion_functions_lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_tzinfo = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_tzinfo,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tzinfo)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("lambda", 1, 2, 2, 1); __PYX_ERR(5, 299, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda") < 0)) __PYX_ERR(5, 299, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_x = values[0];
    __pyx_v_tzinfo = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("lambda", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(5, 299, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._datetime_conversion_functions.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_lambda_funcdef_lambda(__pyx_self, __pyx_v_x, __pyx_v_tzinfo);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_lambda_funcdef_lambda(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":300
 *         _DATETIME_CONVERSION_FUNCTIONS.update({
 *             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(5, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 300, __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(5, 300, __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(5, 300, __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(5, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_tzinfo, __pyx_v_tzinfo) < 0) __PYX_ERR(5, 300, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 300, __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":299
 *     except ImportError:
 *         _DATETIME_CONVERSION_FUNCTIONS.update({
 *             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._datetime_conversion_functions.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":302
 *                 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_30_datetime_conversion_functions_1lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7pyarrow_3lib_30_datetime_conversion_functions_1lambda1 = {"lambda1", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_30_datetime_conversion_functions_1lambda1, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7pyarrow_3lib_30_datetime_conversion_functions_1lambda1(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(5, 302, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda1") < 0)) __PYX_ERR(5, 302, __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(5, 302, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._datetime_conversion_functions.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self, __pyx_v_x, __pyx_v_tzinfo);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_lambda_funcdef_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":304
 *             TimeUnit_MILLI: lambda x, tzinfo: (
 *                 (datetime.datetime.utcfromtimestamp(x / 1e3)
 *                  .replace(tzinfo=tzinfo))             # <<<<<<<<<<<<<<
 *             ),
 *             TimeUnit_MICRO: lambda x, tzinfo: (
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/scalar.pxi":303
 *             ),
 *             TimeUnit_MILLI: lambda x, tzinfo: (
 *                 (datetime.datetime.utcfromtimestamp(x / 1e3)             # <<<<<<<<<<<<<<
 *                  .replace(tzinfo=tzinfo))
 *             ),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 303, __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(5, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyFloat_TrueDivideObjC(__pyx_v_x, __pyx_float_1e3, 1e3, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 303, __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(5, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/scalar.pxi":304
 *             TimeUnit_MILLI: lambda x, tzinfo: (
 *                 (datetime.datetime.utcfromtimestamp(x / 1e3)
 *                  .replace(tzinfo=tzinfo))             # <<<<<<<<<<<<<<
 *             ),
 *             TimeUnit_MICRO: lambda x, tzinfo: (
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_replace); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_tzinfo, __pyx_v_tzinfo) < 0) __PYX_ERR(5, 304, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 304, __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":302
 *                 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._datetime_conversion_functions.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":306
 *                  .replace(tzinfo=tzinfo))
 *             ),
 *             TimeUnit_MICRO: lambda x, tzinfo: (             # <<<<<<<<<<<<<<
 *                 (datetime.datetime.utcfromtimestamp(x / 1e6)
 *                  .replace(tzinfo=tzinfo))
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_30_datetime_conversion_functions_2lambda2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7pyarrow_3lib_30_datetime_conversion_functions_2lambda2 = {"lambda2", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_30_datetime_conversion_functions_2lambda2, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7pyarrow_3lib_30_datetime_conversion_functions_2lambda2(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(5, 306, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda2") < 0)) __PYX_ERR(5, 306, __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(5, 306, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._datetime_conversion_functions.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_lambda_funcdef_lambda2(__pyx_self, __pyx_v_x, __pyx_v_tzinfo);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_lambda_funcdef_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":308
 *             TimeUnit_MICRO: lambda x, tzinfo: (
 *                 (datetime.datetime.utcfromtimestamp(x / 1e6)
 *                  .replace(tzinfo=tzinfo))             # <<<<<<<<<<<<<<
 *             ),
 *         })
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/scalar.pxi":307
 *             ),
 *             TimeUnit_MICRO: lambda x, tzinfo: (
 *                 (datetime.datetime.utcfromtimestamp(x / 1e6)             # <<<<<<<<<<<<<<
 *                  .replace(tzinfo=tzinfo))
 *             ),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 307, __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(5, 307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyFloat_TrueDivideObjC(__pyx_v_x, __pyx_float_1e6, 1e6, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 307, __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(5, 307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/scalar.pxi":308
 *             TimeUnit_MICRO: lambda x, tzinfo: (
 *                 (datetime.datetime.utcfromtimestamp(x / 1e6)
 *                  .replace(tzinfo=tzinfo))             # <<<<<<<<<<<<<<
 *             ),
 *         })
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_replace); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_tzinfo, __pyx_v_tzinfo) < 0) __PYX_ERR(5, 308, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 308, __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":306
 *                  .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._datetime_conversion_functions.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":313
 *     else:
 *         _DATETIME_CONVERSION_FUNCTIONS.update({
 *             TimeUnit_SECOND: lambda x, tzinfo: pd.Timestamp(             # <<<<<<<<<<<<<<
 *                 x * 1000000000, tz=tzinfo, unit='ns',
 *             ),
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_30_datetime_conversion_functions_3lambda3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7pyarrow_3lib_30_datetime_conversion_functions_3lambda3 = {"lambda3", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_30_datetime_conversion_functions_3lambda3, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7pyarrow_3lib_30_datetime_conversion_functions_3lambda3(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(5, 313, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda3") < 0)) __PYX_ERR(5, 313, __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(5, 313, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._datetime_conversion_functions.lambda3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_lambda_funcdef_lambda3(__pyx_self, __pyx_v_x, __pyx_v_tzinfo);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_lambda_funcdef_lambda3(PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_tzinfo) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions *__pyx_cur_scope;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("lambda3", 0);
  __pyx_outer_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_pd)) { __Pyx_RaiseClosureNameError("pd"); __PYX_ERR(5, 313, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_pd, __pyx_n_s_Timestamp); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/scalar.pxi":314
 *         _DATETIME_CONVERSION_FUNCTIONS.update({
 *             TimeUnit_SECOND: lambda x, tzinfo: pd.Timestamp(
 *                 x * 1000000000, tz=tzinfo, unit='ns',             # <<<<<<<<<<<<<<
 *             ),
 *             TimeUnit_MILLI: lambda x, tzinfo: pd.Timestamp(
 */
  __pyx_t_2 = PyNumber_Multiply(__pyx_v_x, __pyx_int_1000000000); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pyarrow/scalar.pxi":313
 *     else:
 *         _DATETIME_CONVERSION_FUNCTIONS.update({
 *             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(5, 313, __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/scalar.pxi":314
 *         _DATETIME_CONVERSION_FUNCTIONS.update({
 *             TimeUnit_SECOND: lambda x, tzinfo: pd.Timestamp(
 *                 x * 1000000000, tz=tzinfo, unit='ns',             # <<<<<<<<<<<<<<
 *             ),
 *             TimeUnit_MILLI: lambda x, tzinfo: pd.Timestamp(
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_tz, __pyx_v_tzinfo) < 0) __PYX_ERR(5, 314, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_unit, __pyx_n_u_ns) < 0) __PYX_ERR(5, 314, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":313
 *     else:
 *         _DATETIME_CONVERSION_FUNCTIONS.update({
 *             TimeUnit_SECOND: lambda x, tzinfo: pd.Timestamp(             # <<<<<<<<<<<<<<
 *                 x * 1000000000, tz=tzinfo, unit='ns',
 *             ),
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 313, __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_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib._datetime_conversion_functions.lambda3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":316
 *                 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_30_datetime_conversion_functions_4lambda4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7pyarrow_3lib_30_datetime_conversion_functions_4lambda4 = {"lambda4", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_30_datetime_conversion_functions_4lambda4, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7pyarrow_3lib_30_datetime_conversion_functions_4lambda4(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(5, 316, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda4") < 0)) __PYX_ERR(5, 316, __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(5, 316, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._datetime_conversion_functions.lambda4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_lambda_funcdef_lambda4(__pyx_self, __pyx_v_x, __pyx_v_tzinfo);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_lambda_funcdef_lambda4(PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_tzinfo) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions *__pyx_cur_scope;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("lambda4", 0);
  __pyx_outer_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_pd)) { __Pyx_RaiseClosureNameError("pd"); __PYX_ERR(5, 316, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_pd, __pyx_n_s_Timestamp); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/scalar.pxi":317
 *             ),
 *             TimeUnit_MILLI: lambda x, tzinfo: pd.Timestamp(
 *                 x * 1000000, tz=tzinfo, unit='ns',             # <<<<<<<<<<<<<<
 *             ),
 *             TimeUnit_MICRO: lambda x, tzinfo: pd.Timestamp(
 */
  __pyx_t_2 = PyNumber_Multiply(__pyx_v_x, __pyx_int_1000000); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pyarrow/scalar.pxi":316
 *                 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(5, 316, __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/scalar.pxi":317
 *             ),
 *             TimeUnit_MILLI: lambda x, tzinfo: pd.Timestamp(
 *                 x * 1000000, tz=tzinfo, unit='ns',             # <<<<<<<<<<<<<<
 *             ),
 *             TimeUnit_MICRO: lambda x, tzinfo: pd.Timestamp(
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_tz, __pyx_v_tzinfo) < 0) __PYX_ERR(5, 317, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_unit, __pyx_n_u_ns) < 0) __PYX_ERR(5, 317, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":316
 *                 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_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 316, __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_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib._datetime_conversion_functions.lambda4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":319
 *                 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_30_datetime_conversion_functions_5lambda5(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7pyarrow_3lib_30_datetime_conversion_functions_5lambda5 = {"lambda5", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_30_datetime_conversion_functions_5lambda5, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7pyarrow_3lib_30_datetime_conversion_functions_5lambda5(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(5, 319, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda5") < 0)) __PYX_ERR(5, 319, __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(5, 319, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._datetime_conversion_functions.lambda5", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_lambda_funcdef_lambda5(__pyx_self, __pyx_v_x, __pyx_v_tzinfo);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_lambda_funcdef_lambda5(PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_tzinfo) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions *__pyx_cur_scope;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("lambda5", 0);
  __pyx_outer_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_pd)) { __Pyx_RaiseClosureNameError("pd"); __PYX_ERR(5, 319, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_pd, __pyx_n_s_Timestamp); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/scalar.pxi":320
 *             ),
 *             TimeUnit_MICRO: lambda x, tzinfo: pd.Timestamp(
 *                 x * 1000, tz=tzinfo, unit='ns',             # <<<<<<<<<<<<<<
 *             ),
 *             TimeUnit_NANO: lambda x, tzinfo: pd.Timestamp(
 */
  __pyx_t_2 = PyNumber_Multiply(__pyx_v_x, __pyx_int_1000); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pyarrow/scalar.pxi":319
 *                 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(5, 319, __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/scalar.pxi":320
 *             ),
 *             TimeUnit_MICRO: lambda x, tzinfo: pd.Timestamp(
 *                 x * 1000, tz=tzinfo, unit='ns',             # <<<<<<<<<<<<<<
 *             ),
 *             TimeUnit_NANO: lambda x, tzinfo: pd.Timestamp(
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_tz, __pyx_v_tzinfo) < 0) __PYX_ERR(5, 320, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_unit, __pyx_n_u_ns) < 0) __PYX_ERR(5, 320, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":319
 *                 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_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 319, __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_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib._datetime_conversion_functions.lambda5", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":322
 *                 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_30_datetime_conversion_functions_6lambda6(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7pyarrow_3lib_30_datetime_conversion_functions_6lambda6 = {"lambda6", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_30_datetime_conversion_functions_6lambda6, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7pyarrow_3lib_30_datetime_conversion_functions_6lambda6(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(5, 322, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda6") < 0)) __PYX_ERR(5, 322, __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(5, 322, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._datetime_conversion_functions.lambda6", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_lambda_funcdef_lambda6(__pyx_self, __pyx_v_x, __pyx_v_tzinfo);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_lambda_funcdef_lambda6(PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_tzinfo) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions *__pyx_cur_scope;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("lambda6", 0);
  __pyx_outer_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_pd)) { __Pyx_RaiseClosureNameError("pd"); __PYX_ERR(5, 322, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_pd, __pyx_n_s_Timestamp); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/scalar.pxi":323
 *             ),
 *             TimeUnit_NANO: lambda x, tzinfo: pd.Timestamp(
 *                 x, tz=tzinfo, unit='ns',             # <<<<<<<<<<<<<<
 *             )
 *         })
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_x);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_tz, __pyx_v_tzinfo) < 0) __PYX_ERR(5, 323, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_unit, __pyx_n_u_ns) < 0) __PYX_ERR(5, 323, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":322
 *                 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_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib._datetime_conversion_functions.lambda6", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":290
 * cdef c_bool _datetime_conversion_initialized = False
 * 
 * cdef _datetime_conversion_functions():             # <<<<<<<<<<<<<<
 *     global _datetime_conversion_initialized
 *     if _datetime_conversion_initialized:
 */

static PyObject *__pyx_f_7pyarrow_3lib__datetime_conversion_functions(void) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("_datetime_conversion_functions", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(5, 290, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }

  /* "pyarrow/scalar.pxi":292
 * cdef _datetime_conversion_functions():
 *     global _datetime_conversion_initialized
 *     if _datetime_conversion_initialized:             # <<<<<<<<<<<<<<
 *         return _DATETIME_CONVERSION_FUNCTIONS
 * 
 */
  __pyx_t_1 = (__pyx_v_7pyarrow_3lib__datetime_conversion_initialized != 0);
  if (__pyx_t_1) {

    /* "pyarrow/scalar.pxi":293
 *     global _datetime_conversion_initialized
 *     if _datetime_conversion_initialized:
 *         return _DATETIME_CONVERSION_FUNCTIONS             # <<<<<<<<<<<<<<
 * 
 *     try:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_7pyarrow_3lib__DATETIME_CONVERSION_FUNCTIONS);
    __pyx_r = __pyx_v_7pyarrow_3lib__DATETIME_CONVERSION_FUNCTIONS;
    goto __pyx_L0;

    /* "pyarrow/scalar.pxi":292
 * cdef _datetime_conversion_functions():
 *     global _datetime_conversion_initialized
 *     if _datetime_conversion_initialized:             # <<<<<<<<<<<<<<
 *         return _DATETIME_CONVERSION_FUNCTIONS
 * 
 */
  }

  /* "pyarrow/scalar.pxi":295
 *         return _DATETIME_CONVERSION_FUNCTIONS
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         import pandas as pd
 *     except ImportError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    /*try:*/ {

      /* "pyarrow/scalar.pxi":296
 * 
 *     try:
 *         import pandas as pd             # <<<<<<<<<<<<<<
 *     except ImportError:
 *         _DATETIME_CONVERSION_FUNCTIONS.update({
 */
      __pyx_t_5 = __Pyx_Import(__pyx_n_s_pandas, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 296, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_cur_scope->__pyx_v_pd = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "pyarrow/scalar.pxi":295
 *         return _DATETIME_CONVERSION_FUNCTIONS
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         import pandas as pd
 *     except ImportError:
 */
    }

    /* "pyarrow/scalar.pxi":312
 *         })
 *     else:
 *         _DATETIME_CONVERSION_FUNCTIONS.update({             # <<<<<<<<<<<<<<
 *             TimeUnit_SECOND: lambda x, tzinfo: pd.Timestamp(
 *                 x * 1000000000, tz=tzinfo, unit='ns',
 */
    /*else:*/ {

      /* "pyarrow/scalar.pxi":313
 *     else:
 *         _DATETIME_CONVERSION_FUNCTIONS.update({
 *             TimeUnit_SECOND: lambda x, tzinfo: pd.Timestamp(             # <<<<<<<<<<<<<<
 *                 x * 1000000000, tz=tzinfo, unit='ns',
 *             ),
 */
      __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 313, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type( arrow::TimeUnit::SECOND); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 313, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_30_datetime_conversion_functions_3lambda3, 0, __pyx_n_s_datetime_conversion_functions_l, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pyarrow_lib, __pyx_d, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 313, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_t_5, __pyx_t_6, __pyx_t_7) < 0) __PYX_ERR(5, 313, __pyx_L6_except_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "pyarrow/scalar.pxi":316
 *                 x * 1000000000, tz=tzinfo, unit='ns',
 *             ),
 *             TimeUnit_MILLI: lambda x, tzinfo: pd.Timestamp(             # <<<<<<<<<<<<<<
 *                 x * 1000000, tz=tzinfo, unit='ns',
 *             ),
 */
      __pyx_t_7 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type( arrow::TimeUnit::MILLI); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 316, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_30_datetime_conversion_functions_4lambda4, 0, __pyx_n_s_datetime_conversion_functions_l, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pyarrow_lib, __pyx_d, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 316, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (PyDict_SetItem(__pyx_t_5, __pyx_t_7, __pyx_t_6) < 0) __PYX_ERR(5, 313, __pyx_L6_except_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "pyarrow/scalar.pxi":319
 *                 x * 1000000, tz=tzinfo, unit='ns',
 *             ),
 *             TimeUnit_MICRO: lambda x, tzinfo: pd.Timestamp(             # <<<<<<<<<<<<<<
 *                 x * 1000, tz=tzinfo, unit='ns',
 *             ),
 */
      __pyx_t_6 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type( arrow::TimeUnit::MICRO); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 319, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_30_datetime_conversion_functions_5lambda5, 0, __pyx_n_s_datetime_conversion_functions_l, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pyarrow_lib, __pyx_d, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 319, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_t_5, __pyx_t_6, __pyx_t_7) < 0) __PYX_ERR(5, 313, __pyx_L6_except_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "pyarrow/scalar.pxi":322
 *                 x * 1000, tz=tzinfo, unit='ns',
 *             ),
 *             TimeUnit_NANO: lambda x, tzinfo: pd.Timestamp(             # <<<<<<<<<<<<<<
 *                 x, tz=tzinfo, unit='ns',
 *             )
 */
      __pyx_t_7 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type( arrow::TimeUnit::NANO); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 322, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_30_datetime_conversion_functions_6lambda6, 0, __pyx_n_s_datetime_conversion_functions_l, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pyarrow_lib, __pyx_d, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 322, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (PyDict_SetItem(__pyx_t_5, __pyx_t_7, __pyx_t_6) < 0) __PYX_ERR(5, 313, __pyx_L6_except_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "pyarrow/scalar.pxi":312
 *         })
 *     else:
 *         _DATETIME_CONVERSION_FUNCTIONS.update({             # <<<<<<<<<<<<<<
 *             TimeUnit_SECOND: lambda x, tzinfo: pd.Timestamp(
 *                 x * 1000000000, tz=tzinfo, unit='ns',
 */
      __pyx_t_6 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_update, __pyx_v_7pyarrow_3lib__DATETIME_CONVERSION_FUNCTIONS, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 312, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L9_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pyarrow/scalar.pxi":297
 *     try:
 *         import pandas as pd
 *     except ImportError:             # <<<<<<<<<<<<<<
 *         _DATETIME_CONVERSION_FUNCTIONS.update({
 *             TimeUnit_SECOND: lambda x, tzinfo: (
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_8) {
      __Pyx_AddTraceback("pyarrow.lib._datetime_conversion_functions", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_7) < 0) __PYX_ERR(5, 297, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_7);

      /* "pyarrow/scalar.pxi":299
 *     except ImportError:
 *         _DATETIME_CONVERSION_FUNCTIONS.update({
 *             TimeUnit_SECOND: lambda x, tzinfo: (             # <<<<<<<<<<<<<<
 *                 datetime.datetime.utcfromtimestamp(x).replace(tzinfo=tzinfo)
 *             ),
 */
      __pyx_t_9 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 299, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type( arrow::TimeUnit::SECOND); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 299, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_30_datetime_conversion_functions_lambda, 0, __pyx_n_s_datetime_conversion_functions_l, NULL, __pyx_n_s_pyarrow_lib, __pyx_d, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 299, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (PyDict_SetItem(__pyx_t_9, __pyx_t_10, __pyx_t_11) < 0) __PYX_ERR(5, 299, __pyx_L6_except_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "pyarrow/scalar.pxi":302
 *                 datetime.datetime.utcfromtimestamp(x).replace(tzinfo=tzinfo)
 *             ),
 *             TimeUnit_MILLI: lambda x, tzinfo: (             # <<<<<<<<<<<<<<
 *                 (datetime.datetime.utcfromtimestamp(x / 1e3)
 *                  .replace(tzinfo=tzinfo))
 */
      __pyx_t_11 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type( arrow::TimeUnit::MILLI); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 302, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_30_datetime_conversion_functions_1lambda1, 0, __pyx_n_s_datetime_conversion_functions_l, NULL, __pyx_n_s_pyarrow_lib, __pyx_d, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 302, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (PyDict_SetItem(__pyx_t_9, __pyx_t_11, __pyx_t_10) < 0) __PYX_ERR(5, 299, __pyx_L6_except_error)
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "pyarrow/scalar.pxi":306
 *                  .replace(tzinfo=tzinfo))
 *             ),
 *             TimeUnit_MICRO: lambda x, tzinfo: (             # <<<<<<<<<<<<<<
 *                 (datetime.datetime.utcfromtimestamp(x / 1e6)
 *                  .replace(tzinfo=tzinfo))
 */
      __pyx_t_10 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type( arrow::TimeUnit::MICRO); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 306, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_30_datetime_conversion_functions_2lambda2, 0, __pyx_n_s_datetime_conversion_functions_l, NULL, __pyx_n_s_pyarrow_lib, __pyx_d, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 306, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (PyDict_SetItem(__pyx_t_9, __pyx_t_10, __pyx_t_11) < 0) __PYX_ERR(5, 299, __pyx_L6_except_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "pyarrow/scalar.pxi":298
 *         import pandas as pd
 *     except ImportError:
 *         _DATETIME_CONVERSION_FUNCTIONS.update({             # <<<<<<<<<<<<<<
 *             TimeUnit_SECOND: lambda x, tzinfo: (
 *                 datetime.datetime.utcfromtimestamp(x).replace(tzinfo=tzinfo)
 */
      __pyx_t_11 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_update, __pyx_v_7pyarrow_3lib__DATETIME_CONVERSION_FUNCTIONS, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 298, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L5_exception_handled;
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "pyarrow/scalar.pxi":295
 *         return _DATETIME_CONVERSION_FUNCTIONS
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         import pandas as pd
 *     except ImportError:
 */
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L1_error;
    __pyx_L5_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    __pyx_L9_try_end:;
  }

  /* "pyarrow/scalar.pxi":326
 *             )
 *         })
 *     _datetime_conversion_initialized = True             # <<<<<<<<<<<<<<
 *     return _DATETIME_CONVERSION_FUNCTIONS
 * 
 */
  __pyx_v_7pyarrow_3lib__datetime_conversion_initialized = 1;

  /* "pyarrow/scalar.pxi":327
 *         })
 *     _datetime_conversion_initialized = True
 *     return _DATETIME_CONVERSION_FUNCTIONS             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_7pyarrow_3lib__DATETIME_CONVERSION_FUNCTIONS);
  __pyx_r = __pyx_v_7pyarrow_3lib__DATETIME_CONVERSION_FUNCTIONS;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":290
 * cdef c_bool _datetime_conversion_initialized = False
 * 
 * cdef _datetime_conversion_functions():             # <<<<<<<<<<<<<<
 *     global _datetime_conversion_initialized
 *     if _datetime_conversion_initialized:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("pyarrow.lib._datetime_conversion_functions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":336
 * 
 *     @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":337
 *     @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":338
 *     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":339
 *         cdef CTimestampArray* ap = <CTimestampArray*> self.sp_array.get()
 *         cdef CTimestampType* dtype = <CTimestampType*> ap.type().get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":336
 * 
 *     @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":341
 *         return ap.Value(self.index)
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Pandas Timestamp instance (if available),
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14TimestampValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14TimestampValue_as_py[] = "TimestampValue.as_py(self)\n\n        Return this value as a Pandas Timestamp instance (if available),\n        otherwise as a Python datetime.timedelta instance.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_14TimestampValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14TimestampValue_as_py(((struct __pyx_obj_7pyarrow_3lib_TimestampValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14TimestampValue_as_py(struct __pyx_obj_7pyarrow_3lib_TimestampValue *__pyx_v_self) {
   arrow::TimestampArray *__pyx_v_ap;
   arrow::TimestampType *__pyx_v_dtype;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_v_tzinfo = NULL;
  PyObject *__pyx_v_converter = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":346
 *         otherwise as a Python datetime.timedelta instance.
 *         """
 *         cdef CTimestampArray* ap = <CTimestampArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         cdef CTimestampType* dtype = <CTimestampType*> ap.type().get()
 * 
 */
  __pyx_v_ap = (( arrow::TimestampArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":347
 *         """
 *         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":349
 *         cdef CTimestampType* dtype = <CTimestampType*> ap.type().get()
 * 
 *         value = self.value             # <<<<<<<<<<<<<<
 * 
 *         if not dtype.timezone().empty():
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_value = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":351
 *         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":352
 * 
 *         if not dtype.timezone().empty():
 *             tzinfo = string_to_tzinfo(frombytes(dtype.timezone()))             # <<<<<<<<<<<<<<
 *         else:
 *             tzinfo = None
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_string_to_tzinfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 352, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 352, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_dtype->timezone()); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 352, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 352, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 352, __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":351
 *         value = self.value
 * 
 *         if not dtype.timezone().empty():             # <<<<<<<<<<<<<<
 *             tzinfo = string_to_tzinfo(frombytes(dtype.timezone()))
 *         else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/scalar.pxi":354
 *             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":356
 *             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":357
 * 
 *         try:
 *             converter = _datetime_conversion_functions()[dtype.unit()]             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             raise ValueError(
 */
      __pyx_t_1 = __pyx_f_7pyarrow_3lib__datetime_conversion_functions(); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 357, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(__pyx_v_dtype->unit()); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 357, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 357, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_converter = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "pyarrow/scalar.pxi":356
 *             tzinfo = None
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             converter = _datetime_conversion_functions()[dtype.unit()]
 *         except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    goto __pyx_L9_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "pyarrow/scalar.pxi":358
 *         try:
 *             converter = _datetime_conversion_functions()[dtype.unit()]
 *         except KeyError:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 'Cannot convert nanosecond timestamps without pandas'
 */
    __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_11) {
      __Pyx_AddTraceback("pyarrow.lib.TimestampValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_1) < 0) __PYX_ERR(5, 358, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_t_1);

      /* "pyarrow/scalar.pxi":359
 *             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__61, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 359, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_ERR(5, 359, __pyx_L6_except_error)
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "pyarrow/scalar.pxi":356
 *             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":362
 *                 'Cannot convert nanosecond timestamps without pandas'
 *             )
 *         return converter(value, tzinfo=tzinfo)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_value);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_tzinfo, __pyx_v_tzinfo) < 0) __PYX_ERR(5, 362, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_converter, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":341
 *         return ap.Value(self.index)
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Pandas Timestamp instance (if available),
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.TimestampValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_tzinfo);
  __Pyx_XDECREF(__pyx_v_converter);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14TimestampValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14TimestampValue_2__reduce_cython__[] = "TimestampValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_14TimestampValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14TimestampValue_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_TimestampValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14TimestampValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_TimestampValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__63, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":370
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python float.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14HalfFloatValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14HalfFloatValue_as_py[] = "HalfFloatValue.as_py(self)\n\n        Return this value as a Python float.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_14HalfFloatValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14HalfFloatValue_as_py(((struct __pyx_obj_7pyarrow_3lib_HalfFloatValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14HalfFloatValue_as_py(struct __pyx_obj_7pyarrow_3lib_HalfFloatValue *__pyx_v_self) {
   arrow::HalfFloatArray *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":374
 *         Return this value as a Python float.
 *         """
 *         cdef CHalfFloatArray* ap = <CHalfFloatArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return PyHalf_FromHalf(ap.Value(self.index))
 * 
 */
  __pyx_v_ap = (( arrow::HalfFloatArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":375
 *         """
 *         cdef CHalfFloatArray* ap = <CHalfFloatArray*> self.sp_array.get()
 *         return PyHalf_FromHalf(ap.Value(self.index))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = arrow::py::PyHalf_FromHalf(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":370
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python float.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.HalfFloatValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14HalfFloatValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14HalfFloatValue_2__reduce_cython__[] = "HalfFloatValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_14HalfFloatValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14HalfFloatValue_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_HalfFloatValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14HalfFloatValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_HalfFloatValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__65, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":383
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python float.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10FloatValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10FloatValue_as_py[] = "FloatValue.as_py(self)\n\n        Return this value as a Python float.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10FloatValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10FloatValue_as_py(((struct __pyx_obj_7pyarrow_3lib_FloatValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10FloatValue_as_py(struct __pyx_obj_7pyarrow_3lib_FloatValue *__pyx_v_self) {
   arrow::FloatArray *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":387
 *         Return this value as a Python float.
 *         """
 *         cdef CFloatArray* ap = <CFloatArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_ap = (( arrow::FloatArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":388
 *         """
 *         cdef CFloatArray* ap = <CFloatArray*> self.sp_array.get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":383
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python float.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FloatValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10FloatValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10FloatValue_2__reduce_cython__[] = "FloatValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10FloatValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10FloatValue_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_FloatValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10FloatValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FloatValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__67, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":396
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python float.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11DoubleValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11DoubleValue_as_py[] = "DoubleValue.as_py(self)\n\n        Return this value as a Python float.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11DoubleValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11DoubleValue_as_py(((struct __pyx_obj_7pyarrow_3lib_DoubleValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11DoubleValue_as_py(struct __pyx_obj_7pyarrow_3lib_DoubleValue *__pyx_v_self) {
   arrow::DoubleArray *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":400
 *         Return this value as a Python float.
 *         """
 *         cdef CDoubleArray* ap = <CDoubleArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_ap = (( arrow::DoubleArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":401
 *         """
 *         cdef CDoubleArray* ap = <CDoubleArray*> self.sp_array.get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":396
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python float.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DoubleValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11DoubleValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11DoubleValue_2__reduce_cython__[] = "DoubleValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11DoubleValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11DoubleValue_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_DoubleValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11DoubleValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DoubleValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__69, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":409
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python Decimal.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12DecimalValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12DecimalValue_as_py[] = "DecimalValue.as_py(self)\n\n        Return this value as a Python Decimal.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12DecimalValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12DecimalValue_as_py(((struct __pyx_obj_7pyarrow_3lib_DecimalValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12DecimalValue_as_py(struct __pyx_obj_7pyarrow_3lib_DecimalValue *__pyx_v_self) {
   arrow::Decimal128Array *__pyx_v_ap;
  std::string __pyx_v_s;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":414
 *         """
 *         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":415
 *         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":416
 *             CDecimal128Array* ap = <CDecimal128Array*> self.sp_array.get()
 *             c_string s = ap.FormatValue(self.index)
 *         return _pydecimal.Decimal(s.decode('utf8'))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pydecimal); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Decimal); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_decode_cpp_string(__pyx_v_s, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 416, __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":409
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python Decimal.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.DecimalValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12DecimalValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12DecimalValue_2__reduce_cython__[] = "DecimalValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_12DecimalValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12DecimalValue_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_DecimalValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12DecimalValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DecimalValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__71, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":424
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python unicode string.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11StringValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11StringValue_as_py[] = "StringValue.as_py(self)\n\n        Return this value as a Python unicode string.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11StringValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11StringValue_as_py(((struct __pyx_obj_7pyarrow_3lib_StringValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11StringValue_as_py(struct __pyx_obj_7pyarrow_3lib_StringValue *__pyx_v_self) {
   arrow::StringArray *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":428
 *         Return this value as a Python unicode string.
 *         """
 *         cdef CStringArray* ap = <CStringArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.GetString(self.index).decode('utf-8')
 * 
 */
  __pyx_v_ap = (( arrow::StringArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":429
 *         """
 *         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(5, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":424
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python unicode string.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.StringValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(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__72, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__73, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":437
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python bytes object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11BinaryValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11BinaryValue_as_py[] = "BinaryValue.as_py(self)\n\n        Return this value as a Python bytes object.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11BinaryValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11BinaryValue_as_py(((struct __pyx_obj_7pyarrow_3lib_BinaryValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11BinaryValue_as_py(struct __pyx_obj_7pyarrow_3lib_BinaryValue *__pyx_v_self) {
  uint8_t const *__pyx_v_ptr;
  int32_t __pyx_v_length;
   arrow::BinaryArray *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":444
 *             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":446
 *             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":447
 * 
 *         ptr = ap.GetValue(self.index, &length)
 *         return cp.PyBytes_FromStringAndSize(<const char*>(ptr), length)             # <<<<<<<<<<<<<<
 * 
 *     def as_buffer(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromStringAndSize(((char const *)__pyx_v_ptr), __pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":437
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python bytes object.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BinaryValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":449
 *         return cp.PyBytes_FromStringAndSize(<const char*>(ptr), length)
 * 
 *     def as_buffer(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a view over this value as a Buffer object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11BinaryValue_3as_buffer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11BinaryValue_2as_buffer[] = "BinaryValue.as_buffer(self)\n\n        Return a view over this value as a Buffer object.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11BinaryValue_3as_buffer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_buffer (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11BinaryValue_2as_buffer(((struct __pyx_obj_7pyarrow_3lib_BinaryValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11BinaryValue_2as_buffer(struct __pyx_obj_7pyarrow_3lib_BinaryValue *__pyx_v_self) {
   arrow::BinaryArray *__pyx_v_ap;
  std::shared_ptr< arrow::Buffer>  __pyx_v_buf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_buffer", 0);

  /* "pyarrow/scalar.pxi":454
 *         """
 *         cdef:
 *             CBinaryArray* ap = <CBinaryArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *             shared_ptr[CBuffer] buf
 * 
 */
  __pyx_v_ap = (( arrow::BinaryArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":457
 *             shared_ptr[CBuffer] buf
 * 
 *         buf = SliceBuffer(ap.value_data(), ap.value_offset(self.index),             # <<<<<<<<<<<<<<
 *                           ap.value_length(self.index))
 *         return pyarrow_wrap_buffer(buf)
 */
  __pyx_v_buf = arrow::SliceBuffer(__pyx_v_ap->value_data(), __pyx_v_ap->value_offset(__pyx_v_self->__pyx_base.index), __pyx_v_ap->value_length(__pyx_v_self->__pyx_base.index));

  /* "pyarrow/scalar.pxi":459
 *         buf = SliceBuffer(ap.value_data(), ap.value_offset(self.index),
 *                           ap.value_length(self.index))
 *         return pyarrow_wrap_buffer(buf)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":449
 *         return cp.PyBytes_FromStringAndSize(<const char*>(ptr), length)
 * 
 *     def as_buffer(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a view over this value as a Buffer object.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BinaryValue.as_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11BinaryValue_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11BinaryValue_4__reduce_cython__[] = "BinaryValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11BinaryValue_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11BinaryValue_4__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_BinaryValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11BinaryValue_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BinaryValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BinaryValue.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11BinaryValue_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11BinaryValue_6__setstate_cython__[] = "BinaryValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11BinaryValue_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11BinaryValue_6__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_BinaryValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11BinaryValue_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BinaryValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":467
 *     """
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of values.
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pyarrow_3lib_9ListValue_1__len__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9ListValue___len__[] = "\n        Return the number of values.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_9ListValue___len__;
#endif
static Py_ssize_t __pyx_pw_7pyarrow_3lib_9ListValue_1__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9ListValue___len__(((struct __pyx_obj_7pyarrow_3lib_ListValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_ssize_t __pyx_pf_7pyarrow_3lib_9ListValue___len__(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "pyarrow/scalar.pxi":471
 *         Return the number of values.
 *         """
 *         return self.length()             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, i):
 */
  __pyx_r = ((struct __pyx_vtabstruct_7pyarrow_3lib_ListValue *)__pyx_v_self->__pyx_base.__pyx_vtab)->length(__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":467
 *     """
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of values.
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":473
 *         return self.length()
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Return the value at the given index.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9ListValue_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9ListValue_2__getitem__[] = "\n        Return the value at the given index.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_9ListValue_2__getitem__;
#endif
static PyObject *__pyx_pw_7pyarrow_3lib_9ListValue_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9ListValue_2__getitem__(((struct __pyx_obj_7pyarrow_3lib_ListValue *)__pyx_v_self), ((PyObject *)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_9ListValue_2__getitem__(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pyarrow/scalar.pxi":477
 *         Return the value at the given index.
 *         """
 *         return self.getitem(_normalize_index(i, self.length()))             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(5, 477, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7pyarrow_3lib__normalize_index(__pyx_t_1, ((struct __pyx_vtabstruct_7pyarrow_3lib_ListValue *)__pyx_v_self->__pyx_base.__pyx_vtab)->length(__pyx_v_self)); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1L))) __PYX_ERR(5, 477, __pyx_L1_error)
  __pyx_t_3 = ((struct __pyx_vtabstruct_7pyarrow_3lib_ListValue *)__pyx_v_self->__pyx_base.__pyx_vtab)->getitem(__pyx_v_self, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":473
 *         return self.length()
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Return the value at the given index.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.ListValue.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pyarrow_3lib_9ListValue_6generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/scalar.pxi":479
 *         return self.getitem(_normalize_index(i, self.length()))
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over this element's values.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9ListValue_5__iter__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9ListValue_4__iter__[] = "\n        Iterate over this element's values.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_9ListValue_4__iter__;
#endif
static PyObject *__pyx_pw_7pyarrow_3lib_9ListValue_5__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9ListValue_4__iter__(((struct __pyx_obj_7pyarrow_3lib_ListValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_9ListValue_4__iter__(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_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(5, 479, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_3lib_9ListValue_6generator3, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_ListValue___iter, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(5, 479, __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_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(5, 479, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":483
 *         Iterate over this element's values.
 *         """
 *         for i in range(len(self)):             # <<<<<<<<<<<<<<
 *             yield self.getitem(i)
 *         raise StopIteration
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(5, 483, __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":484
 *         """
 *         for i in range(len(self)):
 *             yield self.getitem(i)             # <<<<<<<<<<<<<<
 *         raise StopIteration
 * 
 */
    __pyx_t_4 = ((struct __pyx_vtabstruct_7pyarrow_3lib_ListValue *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->getitem(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 484, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(5, 484, __pyx_L1_error)
  }

  /* "pyarrow/scalar.pxi":485
 *         for i in range(len(self)):
 *             yield self.getitem(i)
 *         raise StopIteration             # <<<<<<<<<<<<<<
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):
 */
  __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
  __PYX_ERR(5, 485, __pyx_L1_error)
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/scalar.pxi":479
 *         return self.getitem(_normalize_index(i, self.length()))
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over this element's values.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":487
 *         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":488
 * 
 *     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":489
 *     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":490
 *         self.sp_array = sp_array
 *         self.ap = <CListArray*> sp_array.get()
 *         self.value_type = pyarrow_wrap_data_type(self.ap.value_type())             # <<<<<<<<<<<<<<
 * 
 *     cdef getitem(self, int64_t i):
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_self->ap->value_type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(5, 490, __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":487
 *         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":492
 *         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":493
 * 
 *     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":494
 *     cdef getitem(self, int64_t i):
 *         cdef int64_t j = self.ap.value_offset(self.index) + i
 *         return box_scalar(self.value_type, self.ap.values(), j)             # <<<<<<<<<<<<<<
 * 
 *     cdef int64_t length(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_v_self->value_type);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_box_scalar(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1), __pyx_v_self->ap->values(), __pyx_v_j); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 494, __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":492
 *         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":496
 *         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":497
 * 
 *     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":496
 *         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":499
 *         return self.ap.value_length(self.index)
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python list.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9ListValue_8as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9ListValue_7as_py[] = "ListValue.as_py(self)\n\n        Return this value as a Python list.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_9ListValue_8as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9ListValue_7as_py(((struct __pyx_obj_7pyarrow_3lib_ListValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_9ListValue_7as_py(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self) {
  int64_t __pyx_v_j;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int64_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":505
 *         cdef:
 *             int64_t j
 *             list result = []             # <<<<<<<<<<<<<<
 * 
 *         for j in range(len(self)):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":507
 *             list result = []
 * 
 *         for j in range(len(self)):             # <<<<<<<<<<<<<<
 *             result.append(self.getitem(j).as_py())
 * 
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(5, 507, __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":508
 * 
 *         for j in range(len(self)):
 *             result.append(self.getitem(j).as_py())             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_5 = ((struct __pyx_vtabstruct_7pyarrow_3lib_ListValue *)__pyx_v_self->__pyx_base.__pyx_vtab)->getitem(__pyx_v_self, __pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_as_py); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(5, 508, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyarrow/scalar.pxi":510
 *             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":499
 *         return self.ap.value_length(self.index)
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python list.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.ListValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/lib.pxd":157
 * 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__76, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__77, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":518
 *     """
 * 
 *     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":519
 * 
 *     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":520
 *     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":518
 *     """
 * 
 *     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":522
 *         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":523
 * 
 *     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":524
 *     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":525
 *         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":526
 *         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(5, 526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(5, 526, __pyx_L1_error)
    __pyx_t_2 = __pyx_f_7pyarrow_3lib_box_scalar(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_3), __pyx_v_child, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 526, __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":525
 *         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":528
 *             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(5, 528, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 528, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(5, 528, __pyx_L1_error)

    /* "pyarrow/scalar.pxi":529
 *         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(5, 528, __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":522
 *         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":531
 *                               self.ap.value_offset(i))
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10UnionValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10UnionValue_as_py[] = "UnionValue.as_py(self)\n\n        Return this value as a Python object.\n\n        The exact type depends on the underlying union member.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10UnionValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10UnionValue_as_py(((struct __pyx_obj_7pyarrow_3lib_UnionValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10UnionValue_as_py(struct __pyx_obj_7pyarrow_3lib_UnionValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":537
 *         The exact type depends on the underlying union member.
 *         """
 *         return self.getitem(self.index).as_py()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_UnionValue *)__pyx_v_self->__pyx_base.__pyx_vtab)->getitem(__pyx_v_self, __pyx_v_self->__pyx_base.index); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_as_py); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 537, __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":531
 *                               self.ap.value_offset(i))
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python object.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.UnionValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10UnionValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10UnionValue_2__reduce_cython__[] = "UnionValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10UnionValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10UnionValue_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_UnionValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10UnionValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UnionValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__79, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":545
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python bytes object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20FixedSizeBinaryValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20FixedSizeBinaryValue_as_py[] = "FixedSizeBinaryValue.as_py(self)\n\n        Return this value as a Python bytes object.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_20FixedSizeBinaryValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20FixedSizeBinaryValue_as_py(((struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20FixedSizeBinaryValue_as_py(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryValue *__pyx_v_self) {
   arrow::FixedSizeBinaryArray *__pyx_v_ap;
   arrow::FixedSizeBinaryType *__pyx_v_ap_type;
  int32_t __pyx_v_length;
  char const *__pyx_v_data;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":554
 *             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":555
 *             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":556
 *         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":557
 *         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":558
 *         length = ap_type.byte_width()
 *         data = <const char*> ap.GetValue(self.index)
 *         return cp.PyBytes_FromStringAndSize(data, length)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromStringAndSize(__pyx_v_data, __pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":545
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python bytes object.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeBinaryValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20FixedSizeBinaryValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20FixedSizeBinaryValue_2__reduce_cython__[] = "FixedSizeBinaryValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_20FixedSizeBinaryValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20FixedSizeBinaryValue_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20FixedSizeBinaryValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__81, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":566
 *     """
 * 
 *     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":567
 * 
 *     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":568
 *     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":566
 *     """
 * 
 *     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":570
 *         self.ap = <CStructArray*> sp_array.get()
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         """
 *         Return the child value for the given field name.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11StructValue_1__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11StructValue___getitem__[] = "\n        Return the child value for the given field name.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_11StructValue___getitem__;
#endif
static PyObject *__pyx_pw_7pyarrow_3lib_11StructValue_1__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11StructValue___getitem__(((struct __pyx_obj_7pyarrow_3lib_StructValue *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11StructValue___getitem__(struct __pyx_obj_7pyarrow_3lib_StructValue *__pyx_v_self, PyObject *__pyx_v_key) {
   arrow::StructType *__pyx_v_type;
  int __pyx_v_index;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pyarrow/scalar.pxi":578
 *             int index
 * 
 *         type = <CStructType*> self.type.type             # <<<<<<<<<<<<<<
 *         index = type.GetFieldIndex(tobytes(key))
 * 
 */
  __pyx_v_type = (( arrow::StructType *)__pyx_v_self->__pyx_base.__pyx_base.type->type);

  /* "pyarrow/scalar.pxi":579
 * 
 *         type = <CStructType*> self.type.type
 *         index = type.GetFieldIndex(tobytes(key))             # <<<<<<<<<<<<<<
 * 
 *         if index < 0:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 579, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_index = __pyx_v_type->GetFieldIndex(__pyx_t_4);

  /* "pyarrow/scalar.pxi":581
 *         index = type.GetFieldIndex(tobytes(key))
 * 
 *         if index < 0:             # <<<<<<<<<<<<<<
 *             raise KeyError(key)
 * 
 */
  __pyx_t_5 = ((__pyx_v_index < 0) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "pyarrow/scalar.pxi":582
 * 
 *         if index < 0:
 *             raise KeyError(key)             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_array(self.ap.field(index))[self.index]
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(5, 582, __pyx_L1_error)

    /* "pyarrow/scalar.pxi":581
 *         index = type.GetFieldIndex(tobytes(key))
 * 
 *         if index < 0:             # <<<<<<<<<<<<<<
 *             raise KeyError(key)
 * 
 */
  }

  /* "pyarrow/scalar.pxi":584
 *             raise KeyError(key)
 * 
 *         return pyarrow_wrap_array(self.ap.field(index))[self.index]             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_self->ap->field(__pyx_v_index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_self->__pyx_base.index, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 584, __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":570
 *         self.ap = <CStructArray*> sp_array.get()
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         """
 *         Return the child value for the given field name.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.StructValue.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":586
 *         return pyarrow_wrap_array(self.ap.field(index))[self.index]
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python dict.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11StructValue_3as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11StructValue_2as_py[] = "StructValue.as_py(self)\n\n        Return this value as a Python dict.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11StructValue_3as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11StructValue_2as_py(((struct __pyx_obj_7pyarrow_3lib_StructValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11StructValue_2as_py(struct __pyx_obj_7pyarrow_3lib_StructValue *__pyx_v_self) {
  std::vector<std::shared_ptr< arrow::Field> >  __pyx_v_child_fields;
  PyObject *__pyx_v_wrapped_arrays = NULL;
  PyObject *__pyx_v_child_names = NULL;
  int __pyx_8genexpr2__pyx_v_i;
  std::shared_ptr< arrow::Field>  __pyx_8genexpr3__pyx_v_child;
  PyObject *__pyx_8genexpr4__pyx_v_name = NULL;
  PyObject *__pyx_8genexpr4__pyx_v_child_array = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  std::vector<std::shared_ptr< arrow::Field> > ::iterator __pyx_t_6;
  std::shared_ptr< arrow::Field>  __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *(*__pyx_t_14)(PyObject *);
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":591
 *         """
 *         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":593
 *             vector[shared_ptr[CField]] child_fields = self.type.type.children()
 * 
 *         wrapped_arrays = [pyarrow_wrap_array(self.ap.field(i))             # <<<<<<<<<<<<<<
 *                           for i in range(self.ap.num_fields())]
 *         child_names = [child.get().name() for child in child_fields]
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 593, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "pyarrow/scalar.pxi":594
 * 
 *         wrapped_arrays = [pyarrow_wrap_array(self.ap.field(i))
 *                           for i in range(self.ap.num_fields())]             # <<<<<<<<<<<<<<
 *         child_names = [child.get().name() for child in child_fields]
 *         # Return the struct as a dict
 */
    __pyx_t_2 = __pyx_v_self->ap->num_fields();
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_8genexpr2__pyx_v_i = __pyx_t_4;

      /* "pyarrow/scalar.pxi":593
 *             vector[shared_ptr[CField]] child_fields = self.type.type.children()
 * 
 *         wrapped_arrays = [pyarrow_wrap_array(self.ap.field(i))             # <<<<<<<<<<<<<<
 *                           for i in range(self.ap.num_fields())]
 *         child_names = [child.get().name() for child in child_fields]
 */
      __pyx_t_5 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_self->ap->field(__pyx_8genexpr2__pyx_v_i)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 593, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(5, 593, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  } /* exit inner scope */
  __pyx_v_wrapped_arrays = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":595
 *         wrapped_arrays = [pyarrow_wrap_array(self.ap.field(i))
 *                           for i in range(self.ap.num_fields())]
 *         child_names = [child.get().name() for child in child_fields]             # <<<<<<<<<<<<<<
 *         # Return the struct as a dict
 *         return {
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 595, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __pyx_v_child_fields.begin();
    for (;;) {
      if (!(__pyx_t_6 != __pyx_v_child_fields.end())) break;
      __pyx_t_7 = *__pyx_t_6;
      ++__pyx_t_6;
      __pyx_8genexpr3__pyx_v_child = __pyx_t_7;
      __pyx_t_5 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_8genexpr3__pyx_v_child.get()->name()); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 595, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(5, 595, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  } /* exit inner scope */
  __pyx_v_child_names = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":597
 *         child_names = [child.get().name() for child in child_fields]
 *         # Return the struct as a dict
 *         return {             # <<<<<<<<<<<<<<
 *             frombytes(name): child_array[self.index].as_py()
 *             for name, child_array in
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 597, __pyx_L9_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "pyarrow/scalar.pxi":600
 *             frombytes(name): child_array[self.index].as_py()
 *             for name, child_array in
 *             zip(child_names, wrapped_arrays)             # <<<<<<<<<<<<<<
 *         }
 * 
 */
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 600, __pyx_L9_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_child_names);
    __Pyx_GIVEREF(__pyx_v_child_names);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_child_names);
    __Pyx_INCREF(__pyx_v_wrapped_arrays);
    __Pyx_GIVEREF(__pyx_v_wrapped_arrays);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_wrapped_arrays);
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 600, __pyx_L9_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
      __pyx_t_5 = __pyx_t_8; __Pyx_INCREF(__pyx_t_5); __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 600, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_10 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 600, __pyx_L9_error)
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    for (;;) {
      if (likely(!__pyx_t_10)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(5, 600, __pyx_L9_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 600, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        } else {
          if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(5, 600, __pyx_L9_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 600, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        }
      } else {
        __pyx_t_8 = __pyx_t_10(__pyx_t_5);
        if (unlikely(!__pyx_t_8)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(5, 600, __pyx_L9_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_8);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
        PyObject* sequence = __pyx_t_8;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(5, 599, __pyx_L9_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_11 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_11 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_12 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_12);
        #else
        __pyx_t_11 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 599, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 599, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_12);
        #endif
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_13 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(5, 599, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext;
        index = 0; __pyx_t_11 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_11)) goto __pyx_L12_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_11);
        index = 1; __pyx_t_12 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_12)) goto __pyx_L12_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_12);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) __PYX_ERR(5, 599, __pyx_L9_error)
        __pyx_t_14 = NULL;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        goto __pyx_L13_unpacking_done;
        __pyx_L12_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_14 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(5, 599, __pyx_L9_error)
        __pyx_L13_unpacking_done:;
      }

      /* "pyarrow/scalar.pxi":599
 *         return {
 *             frombytes(name): child_array[self.index].as_py()
 *             for name, child_array in             # <<<<<<<<<<<<<<
 *             zip(child_names, wrapped_arrays)
 *         }
 */
      __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_name, __pyx_t_11);
      __pyx_t_11 = 0;
      __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_child_array, __pyx_t_12);
      __pyx_t_12 = 0;

      /* "pyarrow/scalar.pxi":598
 *         # Return the struct as a dict
 *         return {
 *             frombytes(name): child_array[self.index].as_py()             # <<<<<<<<<<<<<<
 *             for name, child_array in
 *             zip(child_names, wrapped_arrays)
 */
      __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 598, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_11 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_12, function);
        }
      }
      __pyx_t_8 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_11, __pyx_8genexpr4__pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_8genexpr4__pyx_v_name);
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 598, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_11 = __Pyx_GetItemInt(__pyx_8genexpr4__pyx_v_child_array, __pyx_v_self->__pyx_base.index, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 598, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_as_py); if (unlikely(!__pyx_t_13)) __PYX_ERR(5, 598, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_13);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_13, function);
        }
      }
      __pyx_t_12 = (__pyx_t_11) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_11) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 598, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_t_8, (PyObject*)__pyx_t_12))) __PYX_ERR(5, 598, __pyx_L9_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

      /* "pyarrow/scalar.pxi":599
 *         return {
 *             frombytes(name): child_array[self.index].as_py()
 *             for name, child_array in             # <<<<<<<<<<<<<<
 *             zip(child_names, wrapped_arrays)
 *         }
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_child_array); __pyx_8genexpr4__pyx_v_child_array = 0;
    __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_name); __pyx_8genexpr4__pyx_v_name = 0;
    goto __pyx_L14_exit_scope;
    __pyx_L9_error:;
    __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_child_array); __pyx_8genexpr4__pyx_v_child_array = 0;
    __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_name); __pyx_8genexpr4__pyx_v_name = 0;
    goto __pyx_L1_error;
    __pyx_L14_exit_scope:;
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":586
 *         return pyarrow_wrap_array(self.ap.field(index))[self.index]
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python dict.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("pyarrow.lib.StructValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_wrapped_arrays);
  __Pyx_XDECREF(__pyx_v_child_names);
  __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_name);
  __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_child_array);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11StructValue_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11StructValue_4__reduce_cython__[] = "StructValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11StructValue_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11StructValue_4__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_StructValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11StructValue_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_StructValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__83, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":609
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15DictionaryValue_as_py[] = "DictionaryValue.as_py(self)\n\n        Return this value as a Python object.\n\n        The exact type depends on the dictionary value type.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15DictionaryValue_as_py(((struct __pyx_obj_7pyarrow_3lib_DictionaryValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryValue_as_py(struct __pyx_obj_7pyarrow_3lib_DictionaryValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":615
 *         The exact type depends on the dictionary value type.
 *         """
 *         return self.dictionary_value.as_py()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dictionary_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_as_py); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 615, __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":609
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python object.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.DictionaryValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":618
 * 
 *     @property
 *     def index_value(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value's underlying index as a ArrayValue of the right
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryValue_11index_value_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryValue_11index_value_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15DictionaryValue_11index_value___get__(((struct __pyx_obj_7pyarrow_3lib_DictionaryValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryValue_11index_value___get__(struct __pyx_obj_7pyarrow_3lib_DictionaryValue *__pyx_v_self) {
   arrow::DictionaryArray *__pyx_v_darr;
  PyObject *__pyx_v_indices = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/scalar.pxi":623
 *         signed integer type.
 *         """
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.sp_array.get())             # <<<<<<<<<<<<<<
 *         indices = pyarrow_wrap_array(darr.indices())
 *         return indices[self.index]
 */
  __pyx_v_darr = (( arrow::DictionaryArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":624
 *         """
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.sp_array.get())
 *         indices = pyarrow_wrap_array(darr.indices())             # <<<<<<<<<<<<<<
 *         return indices[self.index]
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_darr->indices()); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_indices = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":625
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.sp_array.get())
 *         indices = pyarrow_wrap_array(darr.indices())
 *         return indices[self.index]             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indices, __pyx_v_self->__pyx_base.index, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":618
 * 
 *     @property
 *     def index_value(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value's underlying index as a ArrayValue of the right
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DictionaryValue.index_value.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_indices);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":628
 * 
 *     @property
 *     def dictionary_value(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value's underlying dictionary value as a ArrayValue.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryValue_16dictionary_value_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryValue_16dictionary_value_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15DictionaryValue_16dictionary_value___get__(((struct __pyx_obj_7pyarrow_3lib_DictionaryValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryValue_16dictionary_value___get__(struct __pyx_obj_7pyarrow_3lib_DictionaryValue *__pyx_v_self) {
   arrow::DictionaryArray *__pyx_v_darr;
  PyObject *__pyx_v_dictionary = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/scalar.pxi":632
 *         Return this value's underlying dictionary value as a ArrayValue.
 *         """
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.sp_array.get())             # <<<<<<<<<<<<<<
 *         dictionary = pyarrow_wrap_array(darr.dictionary())
 *         return dictionary[self.index_value.as_py()]
 */
  __pyx_v_darr = (( arrow::DictionaryArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":633
 *         """
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.sp_array.get())
 *         dictionary = pyarrow_wrap_array(darr.dictionary())             # <<<<<<<<<<<<<<
 *         return dictionary[self.index_value.as_py()]
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_darr->dictionary()); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_dictionary = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":634
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.sp_array.get())
 *         dictionary = pyarrow_wrap_array(darr.dictionary())
 *         return dictionary[self.index_value.as_py()]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_index_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_as_py); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_dictionary, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 634, __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":628
 * 
 *     @property
 *     def dictionary_value(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value's underlying dictionary value as a ArrayValue.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.DictionaryValue.dictionary_value.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dictionary);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15DictionaryValue_2__reduce_cython__[] = "DictionaryValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15DictionaryValue_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_DictionaryValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DictionaryValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__85, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":670
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly."
 *                         .format(self.__class__.__name__))
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_11ScalarValue___init__(((struct __pyx_obj_7pyarrow_3lib_ScalarValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_11ScalarValue___init__(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/scalar.pxi":672
 *     def __init__(self):
 *         raise TypeError("Do not call {}'s constructor directly."
 *                         .format(self.__class__.__name__))             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CScalar]& sp_scalar):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Do_not_call_s_constructor_direct_6, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 672, __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, 672, __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, 672, __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, 672, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/scalar.pxi":671
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call {}'s constructor directly."             # <<<<<<<<<<<<<<
 *                         .format(self.__class__.__name__))
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 671, __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, 671, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":670
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly."
 *                         .format(self.__class__.__name__))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.ScalarValue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":674
 *                         .format(self.__class__.__name__))
 * 
 *     cdef void init(self, const shared_ptr[CScalar]& sp_scalar):             # <<<<<<<<<<<<<<
 *         self.sp_scalar = sp_scalar
 * 
 */

static void __pyx_f_7pyarrow_3lib_11ScalarValue_init(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self, std::shared_ptr< arrow::Scalar>  const &__pyx_v_sp_scalar) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/scalar.pxi":675
 * 
 *     cdef void init(self, const shared_ptr[CScalar]& sp_scalar):
 *         self.sp_scalar = sp_scalar             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __pyx_v_self->sp_scalar = __pyx_v_sp_scalar;

  /* "pyarrow/scalar.pxi":674
 *                         .format(self.__class__.__name__))
 * 
 *     cdef void init(self, const shared_ptr[CScalar]& sp_scalar):             # <<<<<<<<<<<<<<
 *         self.sp_scalar = sp_scalar
 * 
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/scalar.pxi":677
 *         self.sp_scalar = sp_scalar
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, 'as_py'):
 *             return repr(self.as_py())
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11ScalarValue_2__repr__(((struct __pyx_obj_7pyarrow_3lib_ScalarValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11ScalarValue_2__repr__(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/scalar.pxi":678
 * 
 *     def __repr__(self):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             return repr(self.as_py())
 *         else:
 */
  __pyx_t_1 = __Pyx_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_u_as_py); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 678, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/scalar.pxi":679
 *     def __repr__(self):
 *         if hasattr(self, 'as_py'):
 *             return repr(self.as_py())             # <<<<<<<<<<<<<<
 *         else:
 *             return super(Scalar, self).__repr__()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_as_py); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 679, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 679, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Repr(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 679, __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":678
 * 
 *     def __repr__(self):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             return repr(self.as_py())
 *         else:
 */
  }

  /* "pyarrow/scalar.pxi":681
 *             return repr(self.as_py())
 *         else:
 *             return super(Scalar, self).__repr__()             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 681, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self));
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 681, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_repr); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 681, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 681, __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":677
 *         self.sp_scalar = sp_scalar
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, 'as_py'):
 *             return repr(self.as_py())
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.ScalarValue.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":683
 *             return super(Scalar, self).__repr__()
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, 'as_py'):
 *             return str(self.as_py())
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11ScalarValue_4__str__(((struct __pyx_obj_7pyarrow_3lib_ScalarValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11ScalarValue_4__str__(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "pyarrow/scalar.pxi":684
 * 
 *     def __str__(self):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             return str(self.as_py())
 *         else:
 */
  __pyx_t_1 = __Pyx_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_u_as_py); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 684, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/scalar.pxi":685
 *     def __str__(self):
 *         if hasattr(self, 'as_py'):
 *             return str(self.as_py())             # <<<<<<<<<<<<<<
 *         else:
 *             return super(Scalar, self).__str__()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_as_py); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 685, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 685, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 685, __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":684
 * 
 *     def __str__(self):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             return str(self.as_py())
 *         else:
 */
  }

  /* "pyarrow/scalar.pxi":687
 *             return str(self.as_py())
 *         else:
 *             return super(Scalar, self).__str__()             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 687, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self));
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 687, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 687, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 687, __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":683
 *             return super(Scalar, self).__repr__()
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, 'as_py'):
 *             return str(self.as_py())
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.ScalarValue.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":689
 *             return super(Scalar, self).__str__()
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if hasattr(self, 'as_py'):
 *             if isinstance(other, ScalarValue):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11ScalarValue_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_11ScalarValue_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11ScalarValue_6__eq__(((struct __pyx_obj_7pyarrow_3lib_ScalarValue *)__pyx_v_self), ((PyObject *)__pyx_v_other));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11ScalarValue_6__eq__(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__eq__", 0);
  __Pyx_INCREF(__pyx_v_other);

  /* "pyarrow/scalar.pxi":690
 * 
 *     def __eq__(self, other):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             if isinstance(other, ScalarValue):
 *                 other = other.as_py()
 */
  __pyx_t_1 = __Pyx_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_u_as_py); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 690, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (likely(__pyx_t_2)) {

    /* "pyarrow/scalar.pxi":691
 *     def __eq__(self, other):
 *         if hasattr(self, 'as_py'):
 *             if isinstance(other, ScalarValue):             # <<<<<<<<<<<<<<
 *                 other = other.as_py()
 *             return self.as_py() == other
 */
    __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_7pyarrow_3lib_ScalarValue); 
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "pyarrow/scalar.pxi":692
 *         if hasattr(self, 'as_py'):
 *             if isinstance(other, ScalarValue):
 *                 other = other.as_py()             # <<<<<<<<<<<<<<
 *             return self.as_py() == other
 *         else:
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_as_py); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 692, __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":691
 *     def __eq__(self, other):
 *         if hasattr(self, 'as_py'):
 *             if isinstance(other, ScalarValue):             # <<<<<<<<<<<<<<
 *                 other = other.as_py()
 *             return self.as_py() == other
 */
    }

    /* "pyarrow/scalar.pxi":693
 *             if isinstance(other, ScalarValue):
 *                 other = other.as_py()
 *             return self.as_py() == other             # <<<<<<<<<<<<<<
 *         else:
 *             raise NotImplemented(
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_as_py); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_other, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 693, __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":690
 * 
 *     def __eq__(self, other):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             if isinstance(other, ScalarValue):
 *                 other = other.as_py()
 */
  }

  /* "pyarrow/scalar.pxi":695
 *             return self.as_py() == other
 *         else:
 *             raise NotImplemented(             # <<<<<<<<<<<<<<
 *                 "Cannot compare scalars that don't support as_py()")
 * 
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_NotImplemented, __pyx_tuple__86, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 695, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(5, 695, __pyx_L1_error)
  }

  /* "pyarrow/scalar.pxi":689
 *             return super(Scalar, self).__str__()
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if hasattr(self, 'as_py'):
 *             if isinstance(other, ScalarValue):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.ScalarValue.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_other);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":698
 *                 "Cannot compare scalars that don't support as_py()")
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash(self.as_py())
 * 
 */

/* Python wrapper */
static Py_hash_t __pyx_pw_7pyarrow_3lib_11ScalarValue_9__hash__(PyObject *__pyx_v_self); /*proto*/
static Py_hash_t __pyx_pw_7pyarrow_3lib_11ScalarValue_9__hash__(PyObject *__pyx_v_self) {
  Py_hash_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11ScalarValue_8__hash__(((struct __pyx_obj_7pyarrow_3lib_ScalarValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_hash_t __pyx_pf_7pyarrow_3lib_11ScalarValue_8__hash__(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self) {
  Py_hash_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_hash_t __pyx_t_4;
  __Pyx_RefNannySetupContext("__hash__", 0);

  /* "pyarrow/scalar.pxi":699
 * 
 *     def __hash__(self):
 *         return hash(self.as_py())             # <<<<<<<<<<<<<<
 * 
 * cdef class UInt8Scalar(ScalarValue):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_as_py); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 699, __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, 699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_4 == ((Py_hash_t)-1))) __PYX_ERR(5, 699, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":698
 *                 "Cannot compare scalars that don't support as_py()")
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash(self.as_py())
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.ScalarValue.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11ScalarValue_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11ScalarValue_10__reduce_cython__[] = "ScalarValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11ScalarValue_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11ScalarValue_10__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_ScalarValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11ScalarValue_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__87, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.ScalarValue.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11ScalarValue_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11ScalarValue_12__setstate_cython__[] = "ScalarValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11ScalarValue_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11ScalarValue_12__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_ScalarValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11ScalarValue_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__88, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.ScalarValue.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":706
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt8Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11UInt8Scalar_as_py[] = "UInt8Scalar.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt8Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11UInt8Scalar_as_py(((struct __pyx_obj_7pyarrow_3lib_UInt8Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11UInt8Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_UInt8Scalar *__pyx_v_self) {
   arrow::UInt8Scalar *__pyx_v_sp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":710
 *         Return this value as a Python int.
 *         """
 *         cdef CUInt8Scalar* sp = <CUInt8Scalar*> self.sp_scalar.get()             # <<<<<<<<<<<<<<
 *         return sp.value
 * 
 */
  __pyx_v_sp = (( arrow::UInt8Scalar *)__pyx_v_self->__pyx_base.sp_scalar.get());

  /* "pyarrow/scalar.pxi":711
 *         """
 *         cdef CUInt8Scalar* sp = <CUInt8Scalar*> self.sp_scalar.get()
 *         return sp.value             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_sp->value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":706
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt8Scalar.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt8Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11UInt8Scalar_2__reduce_cython__[] = "UInt8Scalar.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt8Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11UInt8Scalar_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt8Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11UInt8Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt8Scalar *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__89, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt8Scalar.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt8Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11UInt8Scalar_4__setstate_cython__[] = "UInt8Scalar.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt8Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11UInt8Scalar_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt8Scalar *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11UInt8Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt8Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__90, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt8Scalar.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":719
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Int8Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10Int8Scalar_as_py[] = "Int8Scalar.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10Int8Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Int8Scalar_as_py(((struct __pyx_obj_7pyarrow_3lib_Int8Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10Int8Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_Int8Scalar *__pyx_v_self) {
   arrow::Int8Scalar *__pyx_v_sp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":723
 *         Return this value as a Python int.
 *         """
 *         cdef CInt8Scalar* sp = <CInt8Scalar*> self.sp_scalar.get()             # <<<<<<<<<<<<<<
 *         return sp.value
 * 
 */
  __pyx_v_sp = (( arrow::Int8Scalar *)__pyx_v_self->__pyx_base.sp_scalar.get());

  /* "pyarrow/scalar.pxi":724
 *         """
 *         cdef CInt8Scalar* sp = <CInt8Scalar*> self.sp_scalar.get()
 *         return sp.value             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int8_t(__pyx_v_sp->value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":719
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int8Scalar.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Int8Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10Int8Scalar_2__reduce_cython__[] = "Int8Scalar.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10Int8Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Int8Scalar_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Int8Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10Int8Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int8Scalar *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__91, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int8Scalar.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Int8Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10Int8Scalar_4__setstate_cython__[] = "Int8Scalar.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_10Int8Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Int8Scalar_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_Int8Scalar *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10Int8Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int8Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__92, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int8Scalar.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":732
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt16Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12UInt16Scalar_as_py[] = "UInt16Scalar.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt16Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12UInt16Scalar_as_py(((struct __pyx_obj_7pyarrow_3lib_UInt16Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12UInt16Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_UInt16Scalar *__pyx_v_self) {
   arrow::UInt16Scalar *__pyx_v_sp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":736
 *         Return this value as a Python int.
 *         """
 *         cdef CUInt16Scalar* sp = <CUInt16Scalar*> self.sp_scalar.get()             # <<<<<<<<<<<<<<
 *         return sp.value
 * 
 */
  __pyx_v_sp = (( arrow::UInt16Scalar *)__pyx_v_self->__pyx_base.sp_scalar.get());

  /* "pyarrow/scalar.pxi":737
 *         """
 *         cdef CUInt16Scalar* sp = <CUInt16Scalar*> self.sp_scalar.get()
 *         return sp.value             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_uint16_t(__pyx_v_sp->value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 737, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":732
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt16Scalar.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt16Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12UInt16Scalar_2__reduce_cython__[] = "UInt16Scalar.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt16Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12UInt16Scalar_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt16Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12UInt16Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt16Scalar *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__93, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt16Scalar.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt16Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12UInt16Scalar_4__setstate_cython__[] = "UInt16Scalar.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt16Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12UInt16Scalar_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt16Scalar *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12UInt16Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt16Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__94, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt16Scalar.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":745
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Int16Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Int16Scalar_as_py[] = "Int16Scalar.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11Int16Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Int16Scalar_as_py(((struct __pyx_obj_7pyarrow_3lib_Int16Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Int16Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_Int16Scalar *__pyx_v_self) {
   arrow::Int16Scalar *__pyx_v_sp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":749
 *         Return this value as a Python int.
 *         """
 *         cdef CInt16Scalar* sp = <CInt16Scalar*> self.sp_scalar.get()             # <<<<<<<<<<<<<<
 *         return sp.value
 * 
 */
  __pyx_v_sp = (( arrow::Int16Scalar *)__pyx_v_self->__pyx_base.sp_scalar.get());

  /* "pyarrow/scalar.pxi":750
 *         """
 *         cdef CInt16Scalar* sp = <CInt16Scalar*> self.sp_scalar.get()
 *         return sp.value             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int16_t(__pyx_v_sp->value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":745
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int16Scalar.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Int16Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Int16Scalar_2__reduce_cython__[] = "Int16Scalar.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Int16Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Int16Scalar_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Int16Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Int16Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int16Scalar *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__95, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int16Scalar.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Int16Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Int16Scalar_4__setstate_cython__[] = "Int16Scalar.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Int16Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Int16Scalar_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_Int16Scalar *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Int16Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int16Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__96, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int16Scalar.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":758
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt32Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12UInt32Scalar_as_py[] = "UInt32Scalar.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt32Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12UInt32Scalar_as_py(((struct __pyx_obj_7pyarrow_3lib_UInt32Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12UInt32Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_UInt32Scalar *__pyx_v_self) {
   arrow::UInt32Scalar *__pyx_v_sp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":762
 *         Return this value as a Python int.
 *         """
 *         cdef CUInt32Scalar* sp = <CUInt32Scalar*> self.sp_scalar.get()             # <<<<<<<<<<<<<<
 *         return sp.value
 * 
 */
  __pyx_v_sp = (( arrow::UInt32Scalar *)__pyx_v_self->__pyx_base.sp_scalar.get());

  /* "pyarrow/scalar.pxi":763
 *         """
 *         cdef CUInt32Scalar* sp = <CUInt32Scalar*> self.sp_scalar.get()
 *         return sp.value             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_sp->value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 763, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":758
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt32Scalar.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt32Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12UInt32Scalar_2__reduce_cython__[] = "UInt32Scalar.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt32Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12UInt32Scalar_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt32Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12UInt32Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt32Scalar *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__97, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt32Scalar.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt32Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12UInt32Scalar_4__setstate_cython__[] = "UInt32Scalar.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt32Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12UInt32Scalar_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt32Scalar *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12UInt32Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt32Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__98, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt32Scalar.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":771
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Int32Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Int32Scalar_as_py[] = "Int32Scalar.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11Int32Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Int32Scalar_as_py(((struct __pyx_obj_7pyarrow_3lib_Int32Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Int32Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_Int32Scalar *__pyx_v_self) {
   arrow::Int32Scalar *__pyx_v_sp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":775
 *         Return this value as a Python int.
 *         """
 *         cdef CInt32Scalar* sp = <CInt32Scalar*> self.sp_scalar.get()             # <<<<<<<<<<<<<<
 *         return sp.value
 * 
 */
  __pyx_v_sp = (( arrow::Int32Scalar *)__pyx_v_self->__pyx_base.sp_scalar.get());

  /* "pyarrow/scalar.pxi":776
 *         """
 *         cdef CInt32Scalar* sp = <CInt32Scalar*> self.sp_scalar.get()
 *         return sp.value             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_sp->value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 776, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":771
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int32Scalar.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Int32Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Int32Scalar_2__reduce_cython__[] = "Int32Scalar.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Int32Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Int32Scalar_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Int32Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Int32Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int32Scalar *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__99, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int32Scalar.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Int32Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Int32Scalar_4__setstate_cython__[] = "Int32Scalar.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Int32Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Int32Scalar_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_Int32Scalar *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Int32Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int32Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__100, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int32Scalar.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":784
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt64Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12UInt64Scalar_as_py[] = "UInt64Scalar.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt64Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12UInt64Scalar_as_py(((struct __pyx_obj_7pyarrow_3lib_UInt64Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12UInt64Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_UInt64Scalar *__pyx_v_self) {
   arrow::UInt64Scalar *__pyx_v_sp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":788
 *         Return this value as a Python int.
 *         """
 *         cdef CUInt64Scalar* sp = <CUInt64Scalar*> self.sp_scalar.get()             # <<<<<<<<<<<<<<
 *         return sp.value
 * 
 */
  __pyx_v_sp = (( arrow::UInt64Scalar *)__pyx_v_self->__pyx_base.sp_scalar.get());

  /* "pyarrow/scalar.pxi":789
 *         """
 *         cdef CUInt64Scalar* sp = <CUInt64Scalar*> self.sp_scalar.get()
 *         return sp.value             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_sp->value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":784
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt64Scalar.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt64Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12UInt64Scalar_2__reduce_cython__[] = "UInt64Scalar.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt64Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12UInt64Scalar_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt64Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12UInt64Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt64Scalar *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__101, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt64Scalar.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt64Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12UInt64Scalar_4__setstate_cython__[] = "UInt64Scalar.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt64Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12UInt64Scalar_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt64Scalar *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12UInt64Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt64Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__102, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt64Scalar.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":797
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Int64Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Int64Scalar_as_py[] = "Int64Scalar.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11Int64Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Int64Scalar_as_py(((struct __pyx_obj_7pyarrow_3lib_Int64Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Int64Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_Int64Scalar *__pyx_v_self) {
   arrow::Int64Scalar *__pyx_v_sp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":801
 *         Return this value as a Python int.
 *         """
 *         cdef CInt64Scalar* sp = <CInt64Scalar*> self.sp_scalar.get()             # <<<<<<<<<<<<<<
 *         return sp.value
 * 
 */
  __pyx_v_sp = (( arrow::Int64Scalar *)__pyx_v_self->__pyx_base.sp_scalar.get());

  /* "pyarrow/scalar.pxi":802
 *         """
 *         cdef CInt64Scalar* sp = <CInt64Scalar*> self.sp_scalar.get()
 *         return sp.value             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_sp->value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":797
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int64Scalar.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Int64Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Int64Scalar_2__reduce_cython__[] = "Int64Scalar.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Int64Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Int64Scalar_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Int64Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Int64Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int64Scalar *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__103, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int64Scalar.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Int64Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Int64Scalar_4__setstate_cython__[] = "Int64Scalar.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Int64Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Int64Scalar_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_Int64Scalar *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Int64Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int64Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__104, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int64Scalar.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":810
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python float.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11FloatScalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11FloatScalar_as_py[] = "FloatScalar.as_py(self)\n\n        Return this value as a Python float.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11FloatScalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11FloatScalar_as_py(((struct __pyx_obj_7pyarrow_3lib_FloatScalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11FloatScalar_as_py(struct __pyx_obj_7pyarrow_3lib_FloatScalar *__pyx_v_self) {
   arrow::FloatScalar *__pyx_v_sp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":814
 *         Return this value as a Python float.
 *         """
 *         cdef CFloatScalar* sp = <CFloatScalar*> self.sp_scalar.get()             # <<<<<<<<<<<<<<
 *         return sp.value
 * 
 */
  __pyx_v_sp = (( arrow::FloatScalar *)__pyx_v_self->__pyx_base.sp_scalar.get());

  /* "pyarrow/scalar.pxi":815
 *         """
 *         cdef CFloatScalar* sp = <CFloatScalar*> self.sp_scalar.get()
 *         return sp.value             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_sp->value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 815, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":810
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python float.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FloatScalar.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11FloatScalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11FloatScalar_2__reduce_cython__[] = "FloatScalar.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11FloatScalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11FloatScalar_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_FloatScalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11FloatScalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FloatScalar *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__105, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FloatScalar.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11FloatScalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11FloatScalar_4__setstate_cython__[] = "FloatScalar.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11FloatScalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11FloatScalar_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_FloatScalar *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11FloatScalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FloatScalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__106, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FloatScalar.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":823
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python float.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12DoubleScalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12DoubleScalar_as_py[] = "DoubleScalar.as_py(self)\n\n        Return this value as a Python float.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12DoubleScalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12DoubleScalar_as_py(((struct __pyx_obj_7pyarrow_3lib_DoubleScalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12DoubleScalar_as_py(struct __pyx_obj_7pyarrow_3lib_DoubleScalar *__pyx_v_self) {
   arrow::DoubleScalar *__pyx_v_sp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":827
 *         Return this value as a Python float.
 *         """
 *         cdef CDoubleScalar* sp = <CDoubleScalar*> self.sp_scalar.get()             # <<<<<<<<<<<<<<
 *         return sp.value
 * 
 */
  __pyx_v_sp = (( arrow::DoubleScalar *)__pyx_v_self->__pyx_base.sp_scalar.get());

  /* "pyarrow/scalar.pxi":828
 *         """
 *         cdef CDoubleScalar* sp = <CDoubleScalar*> self.sp_scalar.get()
 *         return sp.value             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_sp->value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 828, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":823
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python float.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DoubleScalar.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12DoubleScalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12DoubleScalar_2__reduce_cython__[] = "DoubleScalar.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_12DoubleScalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12DoubleScalar_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_DoubleScalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12DoubleScalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DoubleScalar *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__107, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DoubleScalar.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12DoubleScalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12DoubleScalar_4__setstate_cython__[] = "DoubleScalar.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_12DoubleScalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12DoubleScalar_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_DoubleScalar *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12DoubleScalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DoubleScalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__108, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DoubleScalar.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":844
 * }
 * 
 * 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":848
 *     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":849
 * 
 *     if type.type.id() == _Type_NA:
 *         return _NULL             # <<<<<<<<<<<<<<
 *     elif sp_array.get().IsNull(index):
 *         return _NULL
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_NULL_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 849, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/scalar.pxi":848
 *     cdef ArrayValue value
 * 
 *     if type.type.id() == _Type_NA:             # <<<<<<<<<<<<<<
 *         return _NULL
 *     elif sp_array.get().IsNull(index):
 */
  }

  /* "pyarrow/scalar.pxi":850
 *     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":851
 *         return _NULL
 *     elif sp_array.get().IsNull(index):
 *         return _NULL             # <<<<<<<<<<<<<<
 *     else:
 *         klass = _array_value_classes[type.type.id()]
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_NULL_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 851, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/scalar.pxi":850
 *     if type.type.id() == _Type_NA:
 *         return _NULL
 *     elif sp_array.get().IsNull(index):             # <<<<<<<<<<<<<<
 *         return _NULL
 *     else:
 */
  }

  /* "pyarrow/scalar.pxi":853
 *         return _NULL
 *     else:
 *         klass = _array_value_classes[type.type.id()]             # <<<<<<<<<<<<<<
 *         value = klass.__new__(klass)
 *         value.init(type, sp_array, index)
 */
  /*else*/ {
    if (unlikely(__pyx_v_7pyarrow_3lib__array_value_classes == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(5, 853, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type(__pyx_v_type->type->id()); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 853, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_7pyarrow_3lib__array_value_classes, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 853, __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":854
 *     else:
 *         klass = _array_value_classes[type.type.id()]
 *         value = klass.__new__(klass)             # <<<<<<<<<<<<<<
 *         value.init(type, sp_array, index)
 *         return value
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_klass, __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 854, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v_klass) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_klass);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 854, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_ArrayValue))))) __PYX_ERR(5, 854, __pyx_L1_error)
    __pyx_v_value = ((struct __pyx_obj_7pyarrow_3lib_ArrayValue *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/scalar.pxi":855
 *         klass = _array_value_classes[type.type.id()]
 *         value = klass.__new__(klass)
 *         value.init(type, sp_array, index)             # <<<<<<<<<<<<<<
 *         return value
 */
    ((struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue *)__pyx_v_value->__pyx_vtab)->init(__pyx_v_value, __pyx_v_type, __pyx_v_sp_array, __pyx_v_index);

    /* "pyarrow/scalar.pxi":856
 *         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":844
 * }
 * 
 * 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(1, 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(1, 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(1, 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 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array(__pyx_v_out); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 41, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/array.pxi":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 inline _is_array_like(obj):             # <<<<<<<<<<<<<<
 *     if isinstance(obj, np.ndarray):
 *         return True
 */

static CYTHON_INLINE PyObject *__pyx_f_7pyarrow_3lib__is_array_like(PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("_is_array_like", 0);

  /* "pyarrow/array.pxi":45
 * 
 * cdef inline _is_array_like(obj):
 *     if isinstance(obj, np.ndarray):             # <<<<<<<<<<<<<<
 *         return True
 *     return pandas_api._have_pandas_internal() and pandas_api.is_array_like(obj)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 45, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/array.pxi":46
 * cdef inline _is_array_like(obj):
 *     if isinstance(obj, np.ndarray):
 *         return True             # <<<<<<<<<<<<<<
 *     return pandas_api._have_pandas_internal() and pandas_api.is_array_like(obj)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;

    /* "pyarrow/array.pxi":45
 * 
 * cdef inline _is_array_like(obj):
 *     if isinstance(obj, np.ndarray):             # <<<<<<<<<<<<<<
 *         return True
 *     return pandas_api._have_pandas_internal() and pandas_api.is_array_like(obj)
 */
  }

  /* "pyarrow/array.pxi":47
 *     if isinstance(obj, np.ndarray):
 *         return True
 *     return pandas_api._have_pandas_internal() and pandas_api.is_array_like(obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim__have_pandas_internal(__pyx_v_7pyarrow_3lib_pandas_api);
  if (__pyx_t_4) {
  } else {
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib__PandasAPIShim *)__pyx_v_7pyarrow_3lib_pandas_api->__pyx_vtab)->is_array_like(__pyx_v_7pyarrow_3lib_pandas_api, __pyx_v_obj, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_L4_bool_binop_done:;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":44
 * 
 * 
 * cdef inline _is_array_like(obj):             # <<<<<<<<<<<<<<
 *     if isinstance(obj, np.ndarray):
 *         return True
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib._is_array_like", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":50
 * 
 * 
 * def _ndarray_to_arrow_type(object values, DataType type):             # <<<<<<<<<<<<<<
 *     return pyarrow_wrap_data_type(_ndarray_to_type(values, type))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_89_ndarray_to_arrow_type(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_88_ndarray_to_arrow_type[] = "_ndarray_to_arrow_type(values, DataType type)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_89_ndarray_to_arrow_type = {"_ndarray_to_arrow_type", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_89_ndarray_to_arrow_type, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_88_ndarray_to_arrow_type};
static PyObject *__pyx_pw_7pyarrow_3lib_89_ndarray_to_arrow_type(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_values = 0;
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_ndarray_to_arrow_type (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_type,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_ndarray_to_arrow_type", 1, 2, 2, 1); __PYX_ERR(1, 50, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_ndarray_to_arrow_type") < 0)) __PYX_ERR(1, 50, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_values = values[0];
    __pyx_v_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_ndarray_to_arrow_type", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 50, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._ndarray_to_arrow_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_type), __pyx_ptype_7pyarrow_3lib_DataType, 1, "type", 0))) __PYX_ERR(1, 50, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_88_ndarray_to_arrow_type(__pyx_self, __pyx_v_values, __pyx_v_type);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_88_ndarray_to_arrow_type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_values, struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr< arrow::DataType>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("_ndarray_to_arrow_type", 0);

  /* "pyarrow/array.pxi":51
 * 
 * def _ndarray_to_arrow_type(object values, DataType type):
 *     return pyarrow_wrap_data_type(_ndarray_to_type(values, type))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__ndarray_to_type(__pyx_v_values, __pyx_v_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 51, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":50
 * 
 * 
 * def _ndarray_to_arrow_type(object values, DataType type):             # <<<<<<<<<<<<<<
 *     return pyarrow_wrap_data_type(_ndarray_to_type(values, type))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib._ndarray_to_arrow_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":54
 * 
 * 
 * cdef shared_ptr[CDataType] _ndarray_to_type(object values,             # <<<<<<<<<<<<<<
 *                                             DataType type) except *:
 *     cdef shared_ptr[CDataType] c_type
 */

static std::shared_ptr< arrow::DataType>  __pyx_f_7pyarrow_3lib__ndarray_to_type(PyObject *__pyx_v_values, struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type) {
  std::shared_ptr< arrow::DataType>  __pyx_v_c_type;
  PyObject *__pyx_v_dtype = NULL;
  std::shared_ptr< arrow::DataType>  __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  std::shared_ptr< arrow::DataType>  __pyx_t_6;
  __Pyx_RefNannySetupContext("_ndarray_to_type", 0);

  /* "pyarrow/array.pxi":58
 *     cdef shared_ptr[CDataType] c_type
 * 
 *     dtype = values.dtype             # <<<<<<<<<<<<<<
 * 
 *     if type is None and dtype != object:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_dtype = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":60
 *     dtype = values.dtype
 * 
 *     if type is None and dtype != object:             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(NumPyDtypeToArrow(dtype, &c_type))
 */
  __pyx_t_3 = (((PyObject *)__pyx_v_type) == Py_None);
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_dtype, __pyx_builtin_object, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 60, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 60, __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":61
 * 
 *     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":62
 *     if type is None and dtype != object:
 *         with nogil:
 *             check_status(NumPyDtypeToArrow(dtype, &c_type))             # <<<<<<<<<<<<<<
 * 
 *     if type is not None:
 */
          __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::NumPyDtypeToArrow(__pyx_v_dtype, (&__pyx_v_c_type))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 62, __pyx_L7_error)
        }

        /* "pyarrow/array.pxi":61
 * 
 *     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":60
 *     dtype = values.dtype
 * 
 *     if type is None and dtype != object:             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(NumPyDtypeToArrow(dtype, &c_type))
 */
  }

  /* "pyarrow/array.pxi":64
 *             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":65
 * 
 *     if type is not None:
 *         c_type = type.sp_type             # <<<<<<<<<<<<<<
 * 
 *     return c_type
 */
    __pyx_t_6 = __pyx_v_type->sp_type;
    __pyx_v_c_type = __pyx_t_6;

    /* "pyarrow/array.pxi":64
 *             check_status(NumPyDtypeToArrow(dtype, &c_type))
 * 
 *     if type is not None:             # <<<<<<<<<<<<<<
 *         c_type = type.sp_type
 * 
 */
  }

  /* "pyarrow/array.pxi":67
 *         c_type = type.sp_type
 * 
 *     return c_type             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_c_type;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":54
 * 
 * 
 * cdef shared_ptr[CDataType] _ndarray_to_type(object values,             # <<<<<<<<<<<<<<
 *                                             DataType type) except *:
 *     cdef shared_ptr[CDataType] c_type
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._ndarray_to_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dtype);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":70
 * 
 * 
 * cdef _ndarray_to_array(object values, object mask, DataType type,             # <<<<<<<<<<<<<<
 *                        c_bool from_pandas, c_bool safe, CMemoryPool* pool):
 *     cdef:
 */

static PyObject *__pyx_f_7pyarrow_3lib__ndarray_to_array(PyObject *__pyx_v_values, PyObject *__pyx_v_mask, struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type, bool __pyx_v_from_pandas, bool __pyx_v_safe,  arrow::MemoryPool *__pyx_v_pool) {
  std::shared_ptr< arrow::ChunkedArray>  __pyx_v_chunked_out;
  std::shared_ptr< arrow::DataType>  __pyx_v_c_type;
   arrow::compute::CastOptions __pyx_v_cast_options;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr< arrow::DataType>  __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("_ndarray_to_array", 0);

  /* "pyarrow/array.pxi":74
 *     cdef:
 *         shared_ptr[CChunkedArray] chunked_out
 *         shared_ptr[CDataType] c_type = _ndarray_to_type(values, type)             # <<<<<<<<<<<<<<
 *         CCastOptions cast_options = CCastOptions(safe)
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__ndarray_to_type(__pyx_v_values, __pyx_v_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 74, __pyx_L1_error)
  __pyx_v_c_type = __pyx_t_1;

  /* "pyarrow/array.pxi":75
 *         shared_ptr[CChunkedArray] chunked_out
 *         shared_ptr[CDataType] c_type = _ndarray_to_type(values, type)
 *         CCastOptions cast_options = CCastOptions(safe)             # <<<<<<<<<<<<<<
 * 
 *     with nogil:
 */
  __pyx_v_cast_options =  arrow::compute::CastOptions(__pyx_v_safe);

  /* "pyarrow/array.pxi":77
 *         CCastOptions cast_options = CCastOptions(safe)
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(NdarrayToArrow(pool, values, mask, from_pandas,
 *                                     c_type, cast_options, &chunked_out))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":78
 * 
 *     with nogil:
 *         check_status(NdarrayToArrow(pool, values, mask, from_pandas,             # <<<<<<<<<<<<<<
 *                                     c_type, cast_options, &chunked_out))
 * 
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::NdarrayToArrow(__pyx_v_pool, __pyx_v_values, __pyx_v_mask, __pyx_v_from_pandas, __pyx_v_c_type, __pyx_v_cast_options, (&__pyx_v_chunked_out))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 78, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":77
 *         CCastOptions cast_options = CCastOptions(safe)
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(NdarrayToArrow(pool, values, mask, from_pandas,
 *                                     c_type, cast_options, &chunked_out))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":81
 *                                     c_type, cast_options, &chunked_out))
 * 
 *     if chunked_out.get().num_chunks() > 1:             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_chunked_array(chunked_out)
 *     else:
 */
  __pyx_t_3 = ((__pyx_v_chunked_out.get()->num_chunks() > 1) != 0);
  if (__pyx_t_3) {

    /* "pyarrow/array.pxi":82
 * 
 *     if chunked_out.get().num_chunks() > 1:
 *         return pyarrow_wrap_chunked_array(chunked_out)             # <<<<<<<<<<<<<<
 *     else:
 *         return pyarrow_wrap_array(chunked_out.get().chunk(0))
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array(__pyx_v_chunked_out); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 82, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/array.pxi":81
 *                                     c_type, cast_options, &chunked_out))
 * 
 *     if chunked_out.get().num_chunks() > 1:             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_chunked_array(chunked_out)
 *     else:
 */
  }

  /* "pyarrow/array.pxi":84
 *         return pyarrow_wrap_chunked_array(chunked_out)
 *     else:
 *         return pyarrow_wrap_array(chunked_out.get().chunk(0))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_chunked_out.get()->chunk(0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 84, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/array.pxi":70
 * 
 * 
 * cdef _ndarray_to_array(object values, object mask, DataType type,             # <<<<<<<<<<<<<<
 *                        c_bool from_pandas, c_bool safe, CMemoryPool* pool):
 *     cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib._ndarray_to_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":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_91array(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_90array[] = "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_91array = {"array", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_91array, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_90array};
static PyObject *__pyx_pw_7pyarrow_3lib_91array(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(1, 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(1, 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(1, 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(1, 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(1, 88, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_90array(__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_90array(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_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7pyarrow_3lib_ensure_type __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(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, allow_none=True)             # <<<<<<<<<<<<<<
 *     cdef CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 * 
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.allow_none = 1;
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_ensure_type(__pyx_v_type, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 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, allow_none=True)
 *     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(1, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(1, 153, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "pyarrow/array.pxi":154
 * 
 *     if _is_array_like(obj):
 *         if mask is not None:             # <<<<<<<<<<<<<<
 *             mask = get_series_values(mask)
 * 
 */
    __pyx_t_3 = (__pyx_v_mask != Py_None);
    __pyx_t_4 = (__pyx_t_3 != 0);
    if (__pyx_t_4) {

      /* "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(1, 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 pandas_api.is_categorical(values):
 */
    __pyx_t_1 = __pyx_f_7pyarrow_3lib_get_series_values(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 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 pandas_api.is_categorical(values):             # <<<<<<<<<<<<<<
 *             return DictionaryArray.from_arrays(
 *                 values.codes, values.categories.values,
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib__PandasAPIShim *)__pyx_v_7pyarrow_3lib_pandas_api->__pyx_vtab)->is_categorical(__pyx_v_7pyarrow_3lib_pandas_api, __pyx_v_values, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 159, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 159, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_4) {

      /* "pyarrow/array.pxi":160
 * 
 *         if pandas_api.is_categorical(values):
 *             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(1, 160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);

      /* "pyarrow/array.pxi":161
 *         if pandas_api.is_categorical(values):
 *             return DictionaryArray.from_arrays(
 *                 values.codes, values.categories.values,             # <<<<<<<<<<<<<<
 *                 mask=mask, ordered=values.ordered,
 *                 from_pandas=True, safe=safe,
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_codes); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 161, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_categories); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 161, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_values); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 161, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "pyarrow/array.pxi":160
 * 
 *         if pandas_api.is_categorical(values):
 *             return DictionaryArray.from_arrays(             # <<<<<<<<<<<<<<
 *                 values.codes, values.categories.values,
 *                 mask=mask, ordered=values.ordered,
 */
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7);
      __pyx_t_5 = 0;
      __pyx_t_7 = 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_7 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 162, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_mask, __pyx_v_mask) < 0) __PYX_ERR(1, 162, __pyx_L1_error)
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_ordered); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_ordered, __pyx_t_5) < 0) __PYX_ERR(1, 162, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_7, __pyx_n_s_from_pandas, Py_True) < 0) __PYX_ERR(1, 162, __pyx_L1_error)
      __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_safe); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_safe, __pyx_t_5) < 0) __PYX_ERR(1, 162, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "pyarrow/array.pxi":164
 *                 mask=mask, ordered=values.ordered,
 *                 from_pandas=True, safe=safe,
 *                 memory_pool=memory_pool)             # <<<<<<<<<<<<<<
 *         else:
 *             if pandas_api.have_pandas:
 */
      if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_memory_pool, ((PyObject *)__pyx_v_memory_pool)) < 0) __PYX_ERR(1, 162, __pyx_L1_error)

      /* "pyarrow/array.pxi":160
 * 
 *         if pandas_api.is_categorical(values):
 *             return DictionaryArray.from_arrays(             # <<<<<<<<<<<<<<
 *                 values.codes, values.categories.values,
 *                 mask=mask, ordered=values.ordered,
 */
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L0;

      /* "pyarrow/array.pxi":159
 *         values = get_series_values(obj)
 * 
 *         if pandas_api.is_categorical(values):             # <<<<<<<<<<<<<<
 *             return DictionaryArray.from_arrays(
 *                 values.codes, values.categories.values,
 */
    }

    /* "pyarrow/array.pxi":166
 *                 memory_pool=memory_pool)
 *         else:
 *             if pandas_api.have_pandas:             # <<<<<<<<<<<<<<
 *                 values, type = pandas_api.compat.get_datetimetz_type(
 *                     values, obj.dtype, type)
 */
    /*else*/ {
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_7pyarrow_3lib_pandas_api), __pyx_n_s_have_pandas); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 166, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_4) {

        /* "pyarrow/array.pxi":167
 *         else:
 *             if pandas_api.have_pandas:
 *                 values, type = pandas_api.compat.get_datetimetz_type(             # <<<<<<<<<<<<<<
 *                     values, obj.dtype, type)
 *             return _ndarray_to_array(values, mask, type, from_pandas, safe,
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_7pyarrow_3lib_pandas_api), __pyx_n_s_compat); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 167, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_get_datetimetz_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 167, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "pyarrow/array.pxi":168
 *             if pandas_api.have_pandas:
 *                 values, type = pandas_api.compat.get_datetimetz_type(
 *                     values, obj.dtype, type)             # <<<<<<<<<<<<<<
 *             return _ndarray_to_array(values, mask, type, from_pandas, safe,
 *                                      pool)
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 168, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_1 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_1)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_v_values, __pyx_t_7, __pyx_v_type};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 167, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_v_values, __pyx_t_7, __pyx_v_type};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 167, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        } else
        #endif
        {
          __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 167, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (__pyx_t_1) {
            __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1); __pyx_t_1 = NULL;
          }
          __Pyx_INCREF(__pyx_v_values);
          __Pyx_GIVEREF(__pyx_v_values);
          PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_values);
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_7);
          __Pyx_INCREF(__pyx_v_type);
          __Pyx_GIVEREF(__pyx_v_type);
          PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_v_type);
          __pyx_t_7 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 167, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
          PyObject* sequence = __pyx_t_5;
          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, 167, __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_9 = PyTuple_GET_ITEM(sequence, 1); 
          } else {
            __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_9 = PyList_GET_ITEM(sequence, 1); 
          }
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_9);
          #else
          __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 167, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 167, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          #endif
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_7 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 167, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_10 = Py_TYPE(__pyx_t_7)->tp_iternext;
          index = 0; __pyx_t_6 = __pyx_t_10(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_6);
          index = 1; __pyx_t_9 = __pyx_t_10(__pyx_t_7); if (unlikely(!__pyx_t_9)) goto __pyx_L7_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_9);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_7), 2) < 0) __PYX_ERR(1, 167, __pyx_L1_error)
          __pyx_t_10 = NULL;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          goto __pyx_L8_unpacking_done;
          __pyx_L7_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_10 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(1, 167, __pyx_L1_error)
          __pyx_L8_unpacking_done:;
        }

        /* "pyarrow/array.pxi":167
 *         else:
 *             if pandas_api.have_pandas:
 *                 values, type = pandas_api.compat.get_datetimetz_type(             # <<<<<<<<<<<<<<
 *                     values, obj.dtype, type)
 *             return _ndarray_to_array(values, mask, type, from_pandas, safe,
 */
        __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_6);
        __pyx_t_6 = 0;
        __Pyx_DECREF_SET(__pyx_v_type, __pyx_t_9);
        __pyx_t_9 = 0;

        /* "pyarrow/array.pxi":166
 *                 memory_pool=memory_pool)
 *         else:
 *             if pandas_api.have_pandas:             # <<<<<<<<<<<<<<
 *                 values, type = pandas_api.compat.get_datetimetz_type(
 *                     values, obj.dtype, type)
 */
      }

      /* "pyarrow/array.pxi":169
 *                 values, type = pandas_api.compat.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(1, 169, __pyx_L1_error)

      /* "pyarrow/array.pxi":170
 *                     values, obj.dtype, type)
 *             return _ndarray_to_array(values, mask, type, from_pandas, safe,
 *                                      pool)             # <<<<<<<<<<<<<<
 *     else:
 *         # ConvertPySequence does strict conversion if type is explicitly passed
 */
      __pyx_t_5 = __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_5)) __PYX_ERR(1, 169, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 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(1, 173, __pyx_L1_error)
    __pyx_t_5 = __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_5)) __PYX_ERR(1, 173, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __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_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_93asarray(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_92asarray[] = "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_93asarray = {"asarray", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_93asarray, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_92asarray};
static PyObject *__pyx_pw_7pyarrow_3lib_93asarray(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_v_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("asarray (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_type,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "asarray") < 0)) __PYX_ERR(1, 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(1, 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_92asarray(__pyx_self, __pyx_v_values, __pyx_v_type);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_92asarray(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(1, 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(1, 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(1, 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(1, 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(1, 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(1, 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(1, 196, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 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(1, 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(1, 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(1, 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_95_normalize_slice(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_94_normalize_slice[] = "_normalize_slice(arrow_obj, slice key)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_95_normalize_slice = {"_normalize_slice", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_95_normalize_slice, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_94_normalize_slice};
static PyObject *__pyx_pw_7pyarrow_3lib_95_normalize_slice(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_arrow_obj = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_normalize_slice (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arrow_obj,&__pyx_n_s_key,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arrow_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_normalize_slice", 1, 2, 2, 1); __PYX_ERR(1, 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(1, 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(1, 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(1, 199, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_94_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_94_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(1, 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(1, 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(1, 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(1, 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(1, 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(1, 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__109, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 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(1, 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(1, 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(1, 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(1, 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(1, 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(1, 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(1, 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(1, 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__110, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 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(1, 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__110, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 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(1, 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__111, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__112, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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(1, 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())
 *     elif datum.kind() == DatumType_SCALAR:
 */
  __pyx_t_1 = ((__pyx_v_datum.kind() ==  arrow::compute::Datum::CHUNKED_ARRAY) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/array.pxi":255
 *         return pyarrow_wrap_array(MakeArray(datum.array()))
 *     elif datum.kind() == DatumType_CHUNKED_ARRAY:
 *         return pyarrow_wrap_chunked_array(datum.chunked_array())             # <<<<<<<<<<<<<<
 *     elif datum.kind() == DatumType_SCALAR:
 *         return pyarrow_wrap_scalar(datum.scalar())
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array(__pyx_v_datum.chunked_array()); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 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())
 *     elif datum.kind() == DatumType_SCALAR:
 */
  }

  /* "pyarrow/array.pxi":256
 *     elif datum.kind() == DatumType_CHUNKED_ARRAY:
 *         return pyarrow_wrap_chunked_array(datum.chunked_array())
 *     elif datum.kind() == DatumType_SCALAR:             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_scalar(datum.scalar())
 *     else:
 */
  __pyx_t_1 = ((__pyx_v_datum.kind() ==  arrow::compute::Datum::SCALAR) != 0);
  if (likely(__pyx_t_1)) {

    /* "pyarrow/array.pxi":257
 *         return pyarrow_wrap_chunked_array(datum.chunked_array())
 *     elif datum.kind() == DatumType_SCALAR:
 *         return pyarrow_wrap_scalar(datum.scalar())             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError("Unable to wrap Datum in a Python object")
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_scalar(__pyx_v_datum.scalar()); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/array.pxi":256
 *     elif datum.kind() == DatumType_CHUNKED_ARRAY:
 *         return pyarrow_wrap_chunked_array(datum.chunked_array())
 *     elif datum.kind() == DatumType_SCALAR:             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_scalar(datum.scalar())
 *     else:
 */
  }

  /* "pyarrow/array.pxi":259
 *         return pyarrow_wrap_scalar(datum.scalar())
 *     else:
 *         raise ValueError("Unable to wrap Datum in a Python object")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__113, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(1, 259, __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":262
 * 
 * 
 * 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":267
 *     """
 *     cdef size_t i, n
 *     assert ad != NULL             # <<<<<<<<<<<<<<
 *     n = ad.buffers.size()
 *     for i in range(n):
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    if (unlikely(!((__pyx_v_ad != NULL) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(1, 267, __pyx_L1_error)
    }
  }
  #endif

  /* "pyarrow/array.pxi":268
 *     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":269
 *     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":270
 *     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":271
 *     for i in range(n):
 *         buf = ad.buffers[i]
 *         res.append(pyarrow_wrap_buffer(buf)             # <<<<<<<<<<<<<<
 *                    if buf.get() != NULL else None)
 *     n = ad.child_data.size()
 */
    if (unlikely(__pyx_v_res == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
      __PYX_ERR(1, 271, __pyx_L1_error)
    }

    /* "pyarrow/array.pxi":272
 *         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":271
 *     for i in range(n):
 *         buf = ad.buffers[i]
 *         res.append(pyarrow_wrap_buffer(buf)             # <<<<<<<<<<<<<<
 *                    if buf.get() != NULL else None)
 *     n = ad.child_data.size()
 */
      __pyx_t_5 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_buf); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 271, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __pyx_t_5;
      __pyx_t_5 = 0;
    } else {

      /* "pyarrow/array.pxi":272
 *         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":271
 *     for i in range(n):
 *         buf = ad.buffers[i]
 *         res.append(pyarrow_wrap_buffer(buf)             # <<<<<<<<<<<<<<
 *                    if buf.get() != NULL else None)
 *     n = ad.child_data.size()
 */
    __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_4); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 271, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }

  /* "pyarrow/array.pxi":273
 *         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":274
 *                    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":275
 *     n = ad.child_data.size()
 *     for i in range(n):
 *         _append_array_buffers(ad.child_data[i].get(), res)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __pyx_f_7pyarrow_3lib__append_array_buffers((__pyx_v_ad->child_data[__pyx_v_i]).get(), __pyx_v_res); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 275, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }

  /* "pyarrow/array.pxi":262
 * 
 * 
 * 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":278
 * 
 * 
 * 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":283
 *     """
 *     cdef size_t i, n
 *     assert ad != NULL             # <<<<<<<<<<<<<<
 * 
 *     n = ad.buffers.size()
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    if (unlikely(!((__pyx_v_ad != NULL) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(1, 283, __pyx_L1_error)
    }
  }
  #endif

  /* "pyarrow/array.pxi":285
 *     assert ad != NULL
 * 
 *     n = ad.buffers.size()             # <<<<<<<<<<<<<<
 *     buffers = []
 *     for i in range(n):
 */
  __pyx_v_n = __pyx_v_ad->buffers.size();

  /* "pyarrow/array.pxi":286
 * 
 *     n = ad.buffers.size()
 *     buffers = []             # <<<<<<<<<<<<<<
 *     for i in range(n):
 *         buf = ad.buffers[i]
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_buffers = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":287
 *     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":288
 *     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":290
 *         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":289
 *     for i in range(n):
 *         buf = ad.buffers[i]
 *         buffers.append(pyarrow_wrap_buffer(buf)             # <<<<<<<<<<<<<<
 *                        if buf.get() != NULL else None)
 * 
 */
      __pyx_t_5 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_buf); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __pyx_t_5;
      __pyx_t_5 = 0;
    } else {

      /* "pyarrow/array.pxi":290
 *         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":289
 *     for i in range(n):
 *         buf = ad.buffers[i]
 *         buffers.append(pyarrow_wrap_buffer(buf)             # <<<<<<<<<<<<<<
 *                        if buf.get() != NULL else None)
 * 
 */
    __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_buffers, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 289, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyarrow/array.pxi":292
 *                        if buf.get() != NULL else None)
 * 
 *     children = []             # <<<<<<<<<<<<<<
 *     n = ad.child_data.size()
 *     for i in range(n):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_children = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":293
 * 
 *     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":294
 *     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":295
 *     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(1, 295, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_children, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 295, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyarrow/array.pxi":297
 *         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(1, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_ad->length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 297, __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(1, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "pyarrow/array.pxi":298
 * 
 *     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(1, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "pyarrow/array.pxi":297
 *         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(1, 297, __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":278
 * 
 * 
 * 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":301
 * 
 * 
 * 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":313
 *         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(1, 313, __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(1, 313, __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(1, 313, __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(1, 313, __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(1, 313, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(1, 313, __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(1, 313, __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(1, 313, __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(1, 313, __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":315
 *     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(1, 315, __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":316
 * 
 *     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(1, 316, __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(1, 316, __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":317
 *     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":318
 *         buf = buffers[i]
 *         if buf is None:
 *             c_buffers.push_back(shared_ptr[CBuffer]())             # <<<<<<<<<<<<<<
 *         else:
 *             c_buffers.push_back(buf.buffer)
 */
      try {
        __pyx_v_c_buffers.push_back(std::shared_ptr< arrow::Buffer> ());
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(1, 318, __pyx_L1_error)
      }

      /* "pyarrow/array.pxi":317
 *     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":320
 *             c_buffers.push_back(shared_ptr[CBuffer]())
 *         else:
 *             c_buffers.push_back(buf.buffer)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(len(children)):
 */
    /*else*/ {
      try {
        __pyx_v_c_buffers.push_back(__pyx_v_buf->buffer);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(1, 320, __pyx_L1_error)
      }
    }
    __pyx_L7:;
  }

  /* "pyarrow/array.pxi":322
 *             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(1, 322, __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":323
 * 
 *     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(1, 323, __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(1, 323, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }

  /* "pyarrow/array.pxi":325
 *         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":301
 * 
 * 
 * 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":334
 * 
 * 
 * def _restore_array(data):             # <<<<<<<<<<<<<<
 *     """
 *     Reconstruct an Array from pickled ArrayData.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_97_restore_array(PyObject *__pyx_self, PyObject *__pyx_v_data); /*proto*/
static char __pyx_doc_7pyarrow_3lib_96_restore_array[] = "_restore_array(data)\n\n    Reconstruct an Array from pickled ArrayData.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_97_restore_array = {"_restore_array", (PyCFunction)__pyx_pw_7pyarrow_3lib_97_restore_array, METH_O, __pyx_doc_7pyarrow_3lib_96_restore_array};
static PyObject *__pyx_pw_7pyarrow_3lib_97_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_96_restore_array(__pyx_self, ((PyObject *)__pyx_v_data));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_96_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":338
 *     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":339
 *     """
 *     cdef shared_ptr[CArrayData] ad = _reconstruct_array_data(data)
 *     return pyarrow_wrap_array(MakeArray(ad))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(arrow::MakeArray(__pyx_v_ad)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":334
 * 
 * 
 * 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":344
 * cdef class _PandasConvertible:
 * 
 *     def to_pandas(self, categories=None, bint strings_to_categorical=False,             # <<<<<<<<<<<<<<
 *                   bint zero_copy_only=False, bint integer_object_nulls=False,
 *                   bint date_as_object=True, bint use_threads=True,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18_PandasConvertible_1to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18_PandasConvertible_to_pandas[] = "_PandasConvertible.to_pandas(self, categories=None, bool strings_to_categorical=False, bool zero_copy_only=False, bool integer_object_nulls=False, bool date_as_object=True, bool use_threads=True, bool deduplicate_objects=True, bool ignore_metadata=False)\n\n        Convert to a pandas-compatible NumPy array or DataFrame, as appropriate\n\n        Parameters\n        ----------\n        strings_to_categorical : boolean, default False\n            Encode string (UTF8) and binary types to pandas.Categorical\n        categories: list, default empty\n            List of fields that should be returned as pandas.Categorical. Only\n            applies to table-like data structures\n        zero_copy_only : boolean, default False\n            Raise an ArrowException if this function call would require copying\n            the underlying data\n        integer_object_nulls : boolean, default False\n            Cast integers with nulls to objects\n        date_as_object : boolean, default False\n            Cast dates to objects\n        use_threads: boolean, default True\n            Whether to parallelize the conversion using multiple threads\n        deduplicate_objects : boolean, default False\n            Do not create multiple copies Python objects when created, to save\n            on memory use. Conversion will be slower\n        ignore_metadata : boolean, default False\n            If True, do not use the 'pandas' metadata to reconstruct the\n            DataFrame index, if present\n\n        Returns\n        -------\n        NumPy array or DataFrame depending on type of object\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_18_PandasConvertible_1to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_categories = 0;
  int __pyx_v_strings_to_categorical;
  int __pyx_v_zero_copy_only;
  int __pyx_v_integer_object_nulls;
  int __pyx_v_date_as_object;
  int __pyx_v_use_threads;
  int __pyx_v_deduplicate_objects;
  int __pyx_v_ignore_metadata;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_pandas (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_categories,&__pyx_n_s_strings_to_categorical,&__pyx_n_s_zero_copy_only,&__pyx_n_s_integer_object_nulls,&__pyx_n_s_date_as_object,&__pyx_n_s_use_threads,&__pyx_n_s_deduplicate_objects,&__pyx_n_s_ignore_metadata,0};
    PyObject* values[8] = {0,0,0,0,0,0,0,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  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_categories);
          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_strings_to_categorical);
          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_zero_copy_only);
          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_integer_object_nulls);
          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_date_as_object);
          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_use_threads);
          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_deduplicate_objects);
          if (value) { values[6] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ignore_metadata);
          if (value) { values[7] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "to_pandas") < 0)) __PYX_ERR(1, 344, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_categories = values[0];
    if (values[1]) {
      __pyx_v_strings_to_categorical = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_strings_to_categorical == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 344, __pyx_L3_error)
    } else {
      __pyx_v_strings_to_categorical = ((int)0);
    }
    if (values[2]) {
      __pyx_v_zero_copy_only = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_zero_copy_only == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
    } else {

      /* "pyarrow/array.pxi":345
 * 
 *     def to_pandas(self, categories=None, bint strings_to_categorical=False,
 *                   bint zero_copy_only=False, bint integer_object_nulls=False,             # <<<<<<<<<<<<<<
 *                   bint date_as_object=True, bint use_threads=True,
 *                   bint deduplicate_objects=True, bint ignore_metadata=False):
 */
      __pyx_v_zero_copy_only = ((int)0);
    }
    if (values[3]) {
      __pyx_v_integer_object_nulls = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_integer_object_nulls == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
    } else {
      __pyx_v_integer_object_nulls = ((int)0);
    }
    if (values[4]) {
      __pyx_v_date_as_object = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_date_as_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 346, __pyx_L3_error)
    } else {

      /* "pyarrow/array.pxi":346
 *     def to_pandas(self, categories=None, bint strings_to_categorical=False,
 *                   bint zero_copy_only=False, bint integer_object_nulls=False,
 *                   bint date_as_object=True, bint use_threads=True,             # <<<<<<<<<<<<<<
 *                   bint deduplicate_objects=True, bint ignore_metadata=False):
 *         """
 */
      __pyx_v_date_as_object = ((int)1);
    }
    if (values[5]) {
      __pyx_v_use_threads = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_use_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 346, __pyx_L3_error)
    } else {
      __pyx_v_use_threads = ((int)1);
    }
    if (values[6]) {
      __pyx_v_deduplicate_objects = __Pyx_PyObject_IsTrue(values[6]); if (unlikely((__pyx_v_deduplicate_objects == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 347, __pyx_L3_error)
    } else {

      /* "pyarrow/array.pxi":347
 *                   bint zero_copy_only=False, bint integer_object_nulls=False,
 *                   bint date_as_object=True, bint use_threads=True,
 *                   bint deduplicate_objects=True, bint ignore_metadata=False):             # <<<<<<<<<<<<<<
 *         """
 *         Convert to a pandas-compatible NumPy array or DataFrame, as appropriate
 */
      __pyx_v_deduplicate_objects = ((int)1);
    }
    if (values[7]) {
      __pyx_v_ignore_metadata = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_ignore_metadata == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 347, __pyx_L3_error)
    } else {
      __pyx_v_ignore_metadata = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_pandas", 0, 0, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 344, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._PandasConvertible.to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_18_PandasConvertible_to_pandas(((struct __pyx_obj_7pyarrow_3lib__PandasConvertible *)__pyx_v_self), __pyx_v_categories, __pyx_v_strings_to_categorical, __pyx_v_zero_copy_only, __pyx_v_integer_object_nulls, __pyx_v_date_as_object, __pyx_v_use_threads, __pyx_v_deduplicate_objects, __pyx_v_ignore_metadata);

  /* "pyarrow/array.pxi":344
 * cdef class _PandasConvertible:
 * 
 *     def to_pandas(self, categories=None, bint strings_to_categorical=False,             # <<<<<<<<<<<<<<
 *                   bint zero_copy_only=False, bint integer_object_nulls=False,
 *                   bint date_as_object=True, bint use_threads=True,
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18_PandasConvertible_to_pandas(struct __pyx_obj_7pyarrow_3lib__PandasConvertible *__pyx_v_self, PyObject *__pyx_v_categories, int __pyx_v_strings_to_categorical, int __pyx_v_zero_copy_only, int __pyx_v_integer_object_nulls, int __pyx_v_date_as_object, int __pyx_v_use_threads, int __pyx_v_deduplicate_objects, int __pyx_v_ignore_metadata) {
  struct arrow::py::PandasOptions __pyx_v_options;
  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;
  __Pyx_RefNannySetupContext("to_pandas", 0);

  /* "pyarrow/array.pxi":383
 * 
 *         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":384
 *         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":385
 *             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/array.pxi":386
 *             zero_copy_only=zero_copy_only,
 *             integer_object_nulls=integer_object_nulls,
 *             date_as_object=date_as_object,             # <<<<<<<<<<<<<<
 *             use_threads=use_threads,
 *             deduplicate_objects=deduplicate_objects)
 */
  __pyx_t_1.date_as_object = __pyx_v_date_as_object;

  /* "pyarrow/array.pxi":387
 *             integer_object_nulls=integer_object_nulls,
 *             date_as_object=date_as_object,
 *             use_threads=use_threads,             # <<<<<<<<<<<<<<
 *             deduplicate_objects=deduplicate_objects)
 * 
 */
  __pyx_t_1.use_threads = __pyx_v_use_threads;

  /* "pyarrow/array.pxi":388
 *             date_as_object=date_as_object,
 *             use_threads=use_threads,
 *             deduplicate_objects=deduplicate_objects)             # <<<<<<<<<<<<<<
 * 
 *         return self._to_pandas(options, categories=categories,
 */
  __pyx_t_1.deduplicate_objects = __pyx_v_deduplicate_objects;
  __pyx_v_options = __pyx_t_1;

  /* "pyarrow/array.pxi":390
 *             deduplicate_objects=deduplicate_objects)
 * 
 *         return self._to_pandas(options, categories=categories,             # <<<<<<<<<<<<<<
 *                                ignore_metadata=ignore_metadata)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_to_pandas); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __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(1, 390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_categories, __pyx_v_categories) < 0) __PYX_ERR(1, 390, __pyx_L1_error)

  /* "pyarrow/array.pxi":391
 * 
 *         return self._to_pandas(options, categories=categories,
 *                                ignore_metadata=ignore_metadata)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_ignore_metadata); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ignore_metadata, __pyx_t_5) < 0) __PYX_ERR(1, 390, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/array.pxi":390
 *             deduplicate_objects=deduplicate_objects)
 * 
 *         return self._to_pandas(options, categories=categories,             # <<<<<<<<<<<<<<
 *                                ignore_metadata=ignore_metadata)
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":344
 * cdef class _PandasConvertible:
 * 
 *     def to_pandas(self, categories=None, bint strings_to_categorical=False,             # <<<<<<<<<<<<<<
 *                   bint zero_copy_only=False, bint integer_object_nulls=False,
 *                   bint date_as_object=True, bint use_threads=True,
 */

  /* 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._PandasConvertible.to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18_PandasConvertible_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18_PandasConvertible_2__reduce_cython__[] = "_PandasConvertible.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_18_PandasConvertible_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18_PandasConvertible_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib__PandasConvertible *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18_PandasConvertible_2__reduce_cython__(struct __pyx_obj_7pyarrow_3lib__PandasConvertible *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = ()             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __Pyx_INCREF(__pyx_empty_tuple);
  __pyx_v_state = __pyx_empty_tuple;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_2 = (__pyx_v__dict != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = False
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = False             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle__PandasConvertible, (type(self), 0xd41d8cd, None), state
 */
  /*else*/ {
    __pyx_v_use_setstate = 0;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle__PandasConvertible, (type(self), 0xd41d8cd, None), state
 *     else:
 */
  __pyx_t_3 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_3) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle__PandasConvertible, (type(self), 0xd41d8cd, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle__PandasConvertible, (type(self), 0xd41d8cd, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle__PandasConvertibl); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_222419149);
    __Pyx_GIVEREF(__pyx_int_222419149);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_222419149);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle__PandasConvertible, (type(self), 0xd41d8cd, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle__PandasConvertible, (type(self), 0xd41d8cd, None), state
 *     else:
 *         return __pyx_unpickle__PandasConvertible, (type(self), 0xd41d8cd, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle__PandasConvertible__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle__PandasConvertibl); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_222419149);
    __Pyx_GIVEREF(__pyx_int_222419149);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_222419149);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib._PandasConvertible.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle__PandasConvertible, (type(self), 0xd41d8cd, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle__PandasConvertible__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18_PandasConvertible_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18_PandasConvertible_4__setstate_cython__[] = "_PandasConvertible.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_18_PandasConvertible_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18_PandasConvertible_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib__PandasConvertible *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18_PandasConvertible_4__setstate_cython__(struct __pyx_obj_7pyarrow_3lib__PandasConvertible *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle__PandasConvertible, (type(self), 0xd41d8cd, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle__PandasConvertible__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(9, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_7pyarrow_3lib___pyx_unpickle__PandasConvertible__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle__PandasConvertible, (type(self), 0xd41d8cd, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle__PandasConvertible__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasConvertible.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":399
 *     """
 * 
 *     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":402
 *         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_u_Do_not_call_s_constructor_direct_7, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 402, __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, 402, __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, 402, __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, 402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/array.pxi":400
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call {}'s constructor directly, use one of "             # <<<<<<<<<<<<<<
 *                         "the `pyarrow.Array.from_*` functions instead."
 *                         .format(self.__class__.__name__))
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 400, __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, 400, __pyx_L1_error)

  /* "pyarrow/array.pxi":399
 *     """
 * 
 *     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":404
 *                         .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":405
 * 
 *     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":406
 *     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":407
 *         self.sp_array = sp_array
 *         self.ap = sp_array.get()
 *         self.type = pyarrow_wrap_data_type(self.sp_array.get().type())             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_self->sp_array.get()->type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 407, __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, 407, __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":404
 *                         .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":409
 *         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":410
 * 
 *     def __eq__(self, other):
 *         raise NotImplementedError('Comparisons with pyarrow.Array are not '             # <<<<<<<<<<<<<<
 *                                   'implemented')
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__114, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 410, __pyx_L1_error)
  __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, 410, __pyx_L1_error)

  /* "pyarrow/array.pxi":409
 *         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":413
 *                                   '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":414
 * 
 *     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":415
 *     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(1, 415, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":414
 * 
 *     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":413
 *                                   '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":417
 *             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(1, 417, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_target_type = values[0];
    if (values[1]) {
      __pyx_v_safe = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_safe == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 417, __pyx_L3_error)
    } else {
      __pyx_v_safe = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cast", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 417, __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":465
 *         """
 *         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":466
 *         cdef:
 *             CCastOptions options = CCastOptions(safe)
 *             DataType type = ensure_type(target_type)             # <<<<<<<<<<<<<<
 *             shared_ptr[CArray] result
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_ensure_type(__pyx_v_target_type, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 466, __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":469
 *             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":470
 * 
 *         with nogil:
 *             check_status(Cast(_context(), self.ap[0], type.sp_type,             # <<<<<<<<<<<<<<
 *                               options, &result))
 * 
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(arrow::compute::Cast(__pyx_f_7pyarrow_3lib__context(), (__pyx_v_self->ap[0]), __pyx_v_type->sp_type, __pyx_v_options, (&__pyx_v_result))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 470, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":469
 *             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":473
 *                               options, &result))
 * 
 *         return pyarrow_wrap_array(result)             # <<<<<<<<<<<<<<
 * 
 *     def sum(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":417
 *             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":475
 *         return pyarrow_wrap_array(result)
 * 
 *     def sum(self):             # <<<<<<<<<<<<<<
 *         """
 *         Sum the values in a numerical array.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_9sum(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_8sum[] = "Array.sum(self)\n\n        Sum the values in a numerical array.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_9sum(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sum (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_8sum(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_8sum(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
   arrow::compute::Datum __pyx_v_out;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("sum", 0);

  /* "pyarrow/array.pxi":481
 *         cdef CDatum out
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(Sum(_context(), CDatum(self.sp_array), &out))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":482
 * 
 *         with nogil:
 *             check_status(Sum(_context(), CDatum(self.sp_array), &out))             # <<<<<<<<<<<<<<
 * 
 *         return wrap_datum(out)
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::compute::Sum(__pyx_f_7pyarrow_3lib__context(),  arrow::compute::Datum(__pyx_v_self->sp_array), (&__pyx_v_out))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 482, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":481
 *         cdef CDatum out
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(Sum(_context(), CDatum(self.sp_array), &out))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":484
 *             check_status(Sum(_context(), CDatum(self.sp_array), &out))
 * 
 *         return wrap_datum(out)             # <<<<<<<<<<<<<<
 * 
 *     def unique(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_wrap_datum(__pyx_v_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":475
 *         return pyarrow_wrap_array(result)
 * 
 *     def sum(self):             # <<<<<<<<<<<<<<
 *         """
 *         Sum the values in a numerical array.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Array.sum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":486
 *         return wrap_datum(out)
 * 
 *     def unique(self):             # <<<<<<<<<<<<<<
 *         """
 *         Compute distinct elements in array
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_11unique(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_10unique[] = "Array.unique(self)\n\n        Compute distinct elements in array\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_11unique(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_10unique(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_10unique(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":492
 *         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":493
 * 
 *         with nogil:
 *             check_status(Unique(_context(), CDatum(self.sp_array), &result))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_array(result)
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::compute::Unique(__pyx_f_7pyarrow_3lib__context(),  arrow::compute::Datum(__pyx_v_self->sp_array), (&__pyx_v_result))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 493, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":492
 *         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":495
 *             check_status(Unique(_context(), CDatum(self.sp_array), &result))
 * 
 *         return pyarrow_wrap_array(result)             # <<<<<<<<<<<<<<
 * 
 *     def dictionary_encode(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":486
 *         return wrap_datum(out)
 * 
 *     def unique(self):             # <<<<<<<<<<<<<<
 *         """
 *         Compute distinct elements in array
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Array.unique", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":497
 *         return pyarrow_wrap_array(result)
 * 
 *     def dictionary_encode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Compute dictionary-encoded representation of array
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_13dictionary_encode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_12dictionary_encode[] = "Array.dictionary_encode(self)\n\n        Compute dictionary-encoded representation of array\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_13dictionary_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_12dictionary_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_12dictionary_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":503
 *         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":504
 * 
 *         with nogil:
 *             check_status(DictionaryEncode(_context(), CDatum(self.sp_array),             # <<<<<<<<<<<<<<
 *                                           &out))
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::compute::DictionaryEncode(__pyx_f_7pyarrow_3lib__context(),  arrow::compute::Datum(__pyx_v_self->sp_array), (&__pyx_v_out))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 504, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":503
 *         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":507
 *                                           &out))
 * 
 *         return wrap_datum(out)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_wrap_datum(__pyx_v_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":497
 *         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":510
 * 
 *     @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_15from_pandas(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_14from_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_15from_pandas = {"from_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_15from_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_14from_pandas};
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_15from_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":511
 *     @staticmethod
 *     def from_pandas(obj, mask=None, type=None, bint safe=True,
 *                     MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert pandas.Series to an Arrow Array, using pandas's semantics about
 */
    values[4] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mask);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_safe);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_pandas") < 0)) __PYX_ERR(1, 510, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_obj = values[0];
    __pyx_v_mask = values[1];
    __pyx_v_type = values[2];
    if (values[3]) {
      __pyx_v_safe = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_safe == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 510, __pyx_L3_error)
    } else {

      /* "pyarrow/array.pxi":510
 * 
 *     @staticmethod
 *     def from_pandas(obj, mask=None, type=None, bint safe=True,             # <<<<<<<<<<<<<<
 *                     MemoryPool memory_pool=None):
 *         """
 */
      __pyx_v_safe = ((int)1);
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[4]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_pandas", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 510, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Array.from_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(1, 511, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_14from_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_14from_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":542
 *         overflows binary buffer)
 *         """
 *         return array(obj, mask=mask, type=type, safe=safe, from_pandas=True,             # <<<<<<<<<<<<<<
 *                      memory_pool=memory_pool)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_obj);
  __Pyx_GIVEREF(__pyx_v_obj);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_mask, __pyx_v_mask) < 0) __PYX_ERR(1, 542, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_type, __pyx_v_type) < 0) __PYX_ERR(1, 542, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_safe); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_safe, __pyx_t_4) < 0) __PYX_ERR(1, 542, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_from_pandas, Py_True) < 0) __PYX_ERR(1, 542, __pyx_L1_error)

  /* "pyarrow/array.pxi":543
 *         """
 *         return array(obj, mask=mask, type=type, safe=safe, from_pandas=True,
 *                      memory_pool=memory_pool)             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_memory_pool, ((PyObject *)__pyx_v_memory_pool)) < 0) __PYX_ERR(1, 542, __pyx_L1_error)

  /* "pyarrow/array.pxi":542
 *         overflows binary buffer)
 *         """
 *         return array(obj, mask=mask, type=type, safe=safe, from_pandas=True,             # <<<<<<<<<<<<<<
 *                      memory_pool=memory_pool)
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 542, __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":510
 * 
 *     @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":545
 *                      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_17__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_16__reduce__[] = "Array.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_17__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_16__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_16__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":546
 * 
 *     def __reduce__(self):
 *         return _restore_array, \             # <<<<<<<<<<<<<<
 *             (_reduce_array_data(self.sp_array.get().data().get()),)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_restore_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/array.pxi":547
 *     def __reduce__(self):
 *         return _restore_array, \
 *             (_reduce_array_data(self.sp_array.get().data().get()),)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __pyx_t_2 = __pyx_f_7pyarrow_3lib__reduce_array_data(__pyx_v_self->sp_array.get()->data().get()); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 547, __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":546
 * 
 *     def __reduce__(self):
 *         return _restore_array, \             # <<<<<<<<<<<<<<
 *             (_reduce_array_data(self.sp_array.get().data().get()),)
 * 
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 546, __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":545
 *                      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":550
 * 
 *     @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_19from_buffers(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_18from_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_19from_buffers = {"from_buffers", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_19from_buffers, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_18from_buffers};
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_19from_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(1, 550, __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(1, 550, __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(1, 550, __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(1, 550, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Array.from_buffers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_type), __pyx_ptype_7pyarrow_3lib_DataType, 1, "type", 0))) __PYX_ERR(1, 550, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_18from_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_18from_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":577
 *             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(1, 577, __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(1, 577, __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":578
 * 
 *         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__115, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 578, __pyx_L1_error)
    __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, 578, __pyx_L1_error)

    /* "pyarrow/array.pxi":577
 *             shared_ptr[CArrayData] ad
 * 
 *         if not is_primitive(type.id):             # <<<<<<<<<<<<<<
 *             raise NotImplementedError("from_buffers is only supported for "
 *                                       "primitive arrays yet.")
 */
  }

  /* "pyarrow/array.pxi":581
 *                                       "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(1, 581, __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(1, 581, __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(1, 581, __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(1, 581, __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(1, 581, __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(1, 581, __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(1, 581, __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(1, 581, __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":583
 *         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(1, 583, __pyx_L1_error)
    }

    /* "pyarrow/array.pxi":581
 *                                       "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":584
 *             # 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(1, 584, __pyx_L1_error)

  /* "pyarrow/array.pxi":585
 *             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(1, 585, __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(1, 585, __pyx_L1_error)

  /* "pyarrow/array.pxi":584
 *             # 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":586
 *         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(1, 586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":550
 * 
 *     @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":589
 * 
 *     @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":590
 *     @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(1, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":589
 * 
 *     @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_22generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/array.pxi":592
 *         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_21__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_21__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_20__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_20__iter__(struct __pyx_obj_7pyarrow_3lib_Array *__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(1, 592, __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_22generator4, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_Array___iter, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(1, 592, __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_22generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__ *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(1, 592, __pyx_L1_error)

  /* "pyarrow/array.pxi":593
 * 
 *     def __iter__(self):
 *         for i in range(len(self)):             # <<<<<<<<<<<<<<
 *             yield self.getitem(i)
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 593, __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":594
 *     def __iter__(self):
 *         for i in range(len(self)):
 *             yield self.getitem(i)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
    __pyx_t_4 = ((struct __pyx_vtabstruct_7pyarrow_3lib_Array *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->getitem(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 594, __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, 594, __pyx_L1_error)
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/array.pxi":592
 *         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":596
 *             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_24__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_24__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_23__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_23__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":597
 * 
 *     def __repr__(self):
 *         type_format = object.__repr__(self)             # <<<<<<<<<<<<<<
 *         return '{0}\n{1}'.format(type_format, str(self))
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_repr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self));
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 597, __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":598
 *     def __repr__(self):
 *         type_format = object.__repr__(self)
 *         return '{0}\n{1}'.format(type_format, str(self))             # <<<<<<<<<<<<<<
 * 
 *     def format(self, int indent=0, int window=10):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_0_1, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_type_format, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_type_format, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 598, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_v_type_format);
    __Pyx_GIVEREF(__pyx_v_type_format);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_type_format);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __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":596
 *             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":600
 *         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_26format(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_25format[] = "Array.format(self, int indent=0, int window=10)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_26format(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_indent;
  int __pyx_v_window;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("format (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indent,&__pyx_n_s_window,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indent);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_window);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "format") < 0)) __PYX_ERR(1, 600, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_indent = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_indent == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 600, __pyx_L3_error)
    } else {
      __pyx_v_indent = ((int)0);
    }
    if (values[1]) {
      __pyx_v_window = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_window == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 600, __pyx_L3_error)
    } else {
      __pyx_v_window = ((int)10);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("format", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 600, __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_25format(((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_25format(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":604
 *             c_string result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(
 *                 PrettyPrint(
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":605
 * 
 *         with nogil:
 *             check_status(             # <<<<<<<<<<<<<<
 *                 PrettyPrint(
 *                     deref(self.ap),
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::PrettyPrint((*__pyx_v_self->ap), arrow::PrettyPrintOptions(__pyx_v_indent, __pyx_v_window), (&__pyx_v_result))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 605, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":604
 *             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":613
 *             )
 * 
 *         return frombytes(result)             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 613, __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":600
 *         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":615
 *         return frombytes(result)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.format()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_28__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_28__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_27__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_27__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":616
 * 
 *     def __str__(self):
 *         return self.format()             # <<<<<<<<<<<<<<
 * 
 *     def equals(Array self, Array other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 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(1, 616, __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":615
 *         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":618
 *         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_30equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_29equals[] = "Array.equals(self, Array other)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_30equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equals (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_7pyarrow_3lib_Array, 1, "other", 0))) __PYX_ERR(1, 618, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_29equals(((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_29equals(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":619
 * 
 *     def equals(Array self, Array other):
 *         return self.ap.Equals(deref(other.ap))             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->ap->Equals((*__pyx_v_other->ap))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":618
 *         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":621
 *         return self.ap.Equals(deref(other.ap))
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.length()
 * 
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pyarrow_3lib_5Array_32__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_7pyarrow_3lib_5Array_32__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_31__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_31__len__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "pyarrow/array.pxi":622
 * 
 *     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":621
 *         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":624
 *         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":625
 * 
 *     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":626
 *     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":625
 * 
 *     cdef int64_t length(self):
 *         if self.sp_array.get():             # <<<<<<<<<<<<<<
 *             return self.sp_array.get().length()
 *         else:
 */
  }

  /* "pyarrow/array.pxi":628
 *             return self.sp_array.get().length()
 *         else:
 *             return 0             # <<<<<<<<<<<<<<
 * 
 *     def isnull(self):
 */
  /*else*/ {
    __pyx_r = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/array.pxi":624
 *         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":630
 *             return 0
 * 
 *     def isnull(self):             # <<<<<<<<<<<<<<
 *         raise NotImplemented
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_34isnull(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_33isnull[] = "Array.isnull(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_34isnull(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_33isnull(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_33isnull(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isnull", 0);

  /* "pyarrow/array.pxi":631
 * 
 *     def isnull(self):
 *         raise NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, index):
 */
  __Pyx_Raise(__pyx_builtin_NotImplemented, 0, 0, 0);
  __PYX_ERR(1, 631, __pyx_L1_error)

  /* "pyarrow/array.pxi":630
 *             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":633
 *         raise NotImplemented
 * 
 *     def __getitem__(self, index):             # <<<<<<<<<<<<<<
 *         """
 *         Return the value at the given index.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_36__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_35__getitem__[] = "\n        Return the value at the given index.\n\n        Returns\n        -------\n        value : Scalar\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_5Array_35__getitem__;
#endif
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_36__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_35__getitem__(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self), ((PyObject *)__pyx_v_index));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_35__getitem__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pyarrow/array.pxi":641
 *         value : Scalar
 *         """
 *         if PySlice_Check(index):             # <<<<<<<<<<<<<<
 *             return _normalize_slice(self, index)
 * 
 */
  __pyx_t_1 = (PySlice_Check(__pyx_v_index) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/array.pxi":642
 *         """
 *         if PySlice_Check(index):
 *             return _normalize_slice(self, index)             # <<<<<<<<<<<<<<
 * 
 *         return self.getitem(_normalize_index(index, self.length()))
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_normalize_slice); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 642, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), __pyx_v_index};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 642, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), __pyx_v_index};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 642, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 642, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_self));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_self));
      __Pyx_INCREF(__pyx_v_index);
      __Pyx_GIVEREF(__pyx_v_index);
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_index);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 642, __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":641
 *         value : Scalar
 *         """
 *         if PySlice_Check(index):             # <<<<<<<<<<<<<<
 *             return _normalize_slice(self, index)
 * 
 */
  }

  /* "pyarrow/array.pxi":644
 *             return _normalize_slice(self, index)
 * 
 *         return self.getitem(_normalize_index(index, self.length()))             # <<<<<<<<<<<<<<
 * 
 *     cdef getitem(self, int64_t i):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 644, __pyx_L1_error)
  __pyx_t_8 = __pyx_f_7pyarrow_3lib__normalize_index(__pyx_t_7, ((struct __pyx_vtabstruct_7pyarrow_3lib_Array *)__pyx_v_self->__pyx_vtab)->length(__pyx_v_self)); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1L))) __PYX_ERR(1, 644, __pyx_L1_error)
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_Array *)__pyx_v_self->__pyx_vtab)->getitem(__pyx_v_self, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":633
 *         raise NotImplemented
 * 
 *     def __getitem__(self, index):             # <<<<<<<<<<<<<<
 *         """
 *         Return the value at the given index.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.Array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":646
 *         return self.getitem(_normalize_index(index, self.length()))
 * 
 *     cdef getitem(self, int64_t i):             # <<<<<<<<<<<<<<
 *         return box_scalar(self.type, self.sp_array, i)
 * 
 */

static PyObject *__pyx_f_7pyarrow_3lib_5Array_getitem(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, int64_t __pyx_v_i) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("getitem", 0);

  /* "pyarrow/array.pxi":647
 * 
 *     cdef getitem(self, int64_t i):
 *         return box_scalar(self.type, self.sp_array, i)             # <<<<<<<<<<<<<<
 * 
 *     def slice(self, offset=0, length=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_v_self->type);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_box_scalar(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1), __pyx_v_self->sp_array, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 647, __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":646
 *         return self.getitem(_normalize_index(index, self.length()))
 * 
 *     cdef getitem(self, int64_t i):             # <<<<<<<<<<<<<<
 *         return box_scalar(self.type, self.sp_array, i)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Array.getitem", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":649
 *         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_38slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_37slice[] = "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_38slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_offset = 0;
  PyObject *__pyx_v_length = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("slice (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_offset,&__pyx_n_s_length,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_int_0);
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_length);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "slice") < 0)) __PYX_ERR(1, 649, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_offset = values[0];
    __pyx_v_length = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("slice", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 649, __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_37slice(((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_37slice(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":668
 *             shared_ptr[CArray] result
 * 
 *         if offset < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError('Offset must be non-negative')
 * 
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_offset, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 668, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 668, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/array.pxi":669
 * 
 *         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__116, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 669, __pyx_L1_error)
    __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, 669, __pyx_L1_error)

    /* "pyarrow/array.pxi":668
 *             shared_ptr[CArray] result
 * 
 *         if offset < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError('Offset must be non-negative')
 * 
 */
  }

  /* "pyarrow/array.pxi":671
 *             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":672
 * 
 *         if length is None:
 *             result = self.ap.Slice(offset)             # <<<<<<<<<<<<<<
 *         else:
 *             result = self.ap.Slice(offset, length)
 */
    __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_v_offset); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 672, __pyx_L1_error)
    __pyx_v_result = __pyx_v_self->ap->Slice(__pyx_t_4);

    /* "pyarrow/array.pxi":671
 *             raise IndexError('Offset must be non-negative')
 * 
 *         if length is None:             # <<<<<<<<<<<<<<
 *             result = self.ap.Slice(offset)
 *         else:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/array.pxi":674
 *             result = self.ap.Slice(offset)
 *         else:
 *             result = self.ap.Slice(offset, length)             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_array(result)
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_v_offset); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 674, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_v_length); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 674, __pyx_L1_error)
    __pyx_v_result = __pyx_v_self->ap->Slice(__pyx_t_4, __pyx_t_5);
  }
  __pyx_L4:;

  /* "pyarrow/array.pxi":676
 *             result = self.ap.Slice(offset, length)
 * 
 *         return pyarrow_wrap_array(result)             # <<<<<<<<<<<<<<
 * 
 *     def _to_pandas(self, options, **kwargs):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":649
 *         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":678
 *         return pyarrow_wrap_array(result)
 * 
 *     def _to_pandas(self, options, **kwargs):             # <<<<<<<<<<<<<<
 *         cdef:
 *             PyObject* out
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_40_to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_39_to_pandas[] = "Array._to_pandas(self, options, **kwargs)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_40_to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_options = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_to_pandas (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_options,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "_to_pandas") < 0)) __PYX_ERR(1, 678, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_options = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_to_pandas", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 678, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("pyarrow.lib.Array._to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_39_to_pandas(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self), __pyx_v_options, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_39_to_pandas(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_options, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_v_out;
  struct arrow::py::PandasOptions __pyx_v_c_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":681
 *         cdef:
 *             PyObject* out
 *             PandasOptions c_options = options             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_1 = __pyx_convert__from_py_struct__arrow_3a__3a_py_3a__3a_PandasOptions(__pyx_v_options); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 681, __pyx_L1_error)
  __pyx_v_c_options = __pyx_t_1;

  /* "pyarrow/array.pxi":683
 *             PandasOptions c_options = options
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(ConvertArrayToPandas(c_options, self.sp_array,
 *                                               self, &out))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":684
 * 
 *         with nogil:
 *             check_status(ConvertArrayToPandas(c_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_c_options, __pyx_v_self->sp_array, ((PyObject *)__pyx_v_self), (&__pyx_v_out))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 684, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":683
 *             PandasOptions c_options = options
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(ConvertArrayToPandas(c_options, self.sp_array,
 *                                               self, &out))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":686
 *             check_status(ConvertArrayToPandas(c_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(1, 686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":678
 *         return pyarrow_wrap_array(result)
 * 
 *     def _to_pandas(self, options, **kwargs):             # <<<<<<<<<<<<<<
 *         cdef:
 *             PyObject* out
 */

  /* 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":688
 *         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_42__array__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_41__array__[] = "Array.__array__(self, dtype=None)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_42__array__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_dtype = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__array__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dtype,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__array__") < 0)) __PYX_ERR(1, 688, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_dtype = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__array__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 688, __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_41__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_41__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":689
 * 
 *     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":690
 *     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_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 690, __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, 690, __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":689
 * 
 *     def __array__(self, dtype=None):
 *         if dtype is None:             # <<<<<<<<<<<<<<
 *             return self.to_pandas()
 *         return self.to_pandas().astype(dtype)
 */
  }

  /* "pyarrow/array.pxi":691
 *         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_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 691, __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(1, 691, __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(1, 691, __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(1, 691, __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":688
 *         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":693
 *         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_44to_numpy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_43to_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_44to_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_43to_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_43to_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":703
 *         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(1, 703, __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(1, 703, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/array.pxi":704
 *         """
 *         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__117, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 704, __pyx_L1_error)
    __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, 704, __pyx_L1_error)

    /* "pyarrow/array.pxi":703
 *         array : numpy.ndarray
 *         """
 *         if self.null_count:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError('NumPy array view is only supported '
 *                                       'for arrays without nulls.')
 */
  }

  /* "pyarrow/array.pxi":706
 *             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(1, 706, __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(1, 706, __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(1, 706, __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(1, 706, __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(1, 706, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 706, __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":707
 *                                       '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__118, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 707, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(1, 707, __pyx_L1_error)

    /* "pyarrow/array.pxi":706
 *             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":709
 *             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(1, 709, __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(1, 709, __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":710
 *                                       '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(1, 710, __pyx_L1_error)
    if (unlikely(!((__pyx_t_7 == 2) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(1, 710, __pyx_L1_error)
    }
  }
  #endif

  /* "pyarrow/array.pxi":711
 *         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(1, 711, __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(1, 711, __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(1, 711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 711, __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(1, 711, __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(1, 711, __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(1, 711, __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(1, 711, __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(1, 711, __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":712
 *         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(1, 712, __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(1, 712, __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(1, 712, __pyx_L1_error)
  __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 712, __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(1, 712, __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":711
 *         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(1, 711, __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":693
 *         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":714
 *             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_46to_pylist(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_45to_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_46to_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_45to_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_45to_pylist(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  PyObject *__pyx_8genexpr5__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("to_pylist", 0);

  /* "pyarrow/array.pxi":722
 *         lst : list
 *         """
 *         return [x.as_py() for x in self]             # <<<<<<<<<<<<<<
 * 
 *     def validate(self):
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 722, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (likely(PyList_CheckExact(((PyObject *)__pyx_v_self))) || PyTuple_CheckExact(((PyObject *)__pyx_v_self))) {
      __pyx_t_2 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
      __pyx_t_4 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 722, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 722, __pyx_L5_error)
    }
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 722, __pyx_L5_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 722, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 722, __pyx_L5_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 722, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_4(__pyx_t_2);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(1, 722, __pyx_L5_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_x, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr5__pyx_v_x, __pyx_n_s_as_py); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 722, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 722, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 722, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_x); __pyx_8genexpr5__pyx_v_x = 0;
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_x); __pyx_8genexpr5__pyx_v_x = 0;
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":714
 *             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_8genexpr5__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":724
 *         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_48validate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_47validate[] = "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_48validate(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_47validate(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_47validate(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":734
 *         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":735
 *         """
 *         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(1, 735, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":734
 *         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":724
 *         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":738
 * 
 *     @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":744
 *         operations with the physical storage buffers.
 *         """
 *         return self.sp_array.get().offset()             # <<<<<<<<<<<<<<
 * 
 *     def buffers(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->sp_array.get()->offset()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":738
 * 
 *     @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":746
 *         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_50buffers(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_49buffers[] = "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_50buffers(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_49buffers(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_49buffers(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":754
 *         multiplied with the size of the stored data type.
 *         """
 *         res = []             # <<<<<<<<<<<<<<
 *         _append_array_buffers(self.sp_array.get().data().get(), res)
 *         return res
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_res = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":755
 *         """
 *         res = []
 *         _append_array_buffers(self.sp_array.get().data().get(), res)             # <<<<<<<<<<<<<<
 *         return res
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__append_array_buffers(__pyx_v_self->sp_array.get()->data().get(), __pyx_v_res); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":756
 *         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":746
 *         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":197
 * 
 *     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":764
 *     """
 * 
 *     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":765
 * 
 *     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__119, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 765, __pyx_L1_error)
  __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, 765, __pyx_L1_error)

  /* "pyarrow/array.pxi":764
 *     """
 * 
 *     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":768
 *                         "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":769
 * 
 *     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":770
 *     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":771
 *         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(1, 771, __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, 771, __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":768
 *                         "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":773
 *         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":774
 * 
 *     def __repr__(self):
 *         return """<pyarrow.Tensor>             # <<<<<<<<<<<<<<
 * type: {0.type}
 * shape: {0.shape}
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/array.pxi":777
 * type: {0.type}
 * shape: {0.shape}
 * strides: {0.strides}""".format(self)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_pyarrow_Tensor_type_0_type_shap, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 777, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self));
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 777, __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":773
 *         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":780
 * 
 *     @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(1, 780, __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(1, 780, __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":782
 *     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":783
 *         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(1, 783, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":782
 *     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":785
 *             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(1, 785, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":780
 * 
 *     @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":787
 *         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":793
 *         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":794
 * 
 *         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(1, 794, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":793
 *         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":795
 *         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(1, 795, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":787
 *         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":797
 *         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(1, 797, __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":801
 *         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(1, 801, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":797
 *         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":803
 *         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":804
 * 
 *     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":805
 *     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(1, 805, __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(1, 805, __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":804
 * 
 *     def __eq__(self, other):
 *         if isinstance(other, Tensor):             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         else:
 */
  }

  /* "pyarrow/array.pxi":807
 *             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":803
 *         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":810
 * 
 *     @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":811
 *     @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(1, 811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":810
 * 
 *     @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":814
 * 
 *     @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":815
 *     @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(1, 815, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":814
 * 
 *     @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":818
 * 
 *     @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":819
 *     @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(1, 819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":818
 * 
 *     @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":822
 * 
 *     @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":823
 *     @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(1, 823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":822
 * 
 *     @property
 *     def 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":826
 * 
 *     @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":828
 *     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(1, 828, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 828, __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":826
 * 
 *     @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":831
 * 
 *     @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":832
 *     @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(1, 832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 832, __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":831
 * 
 *     @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":834
 *         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;
  Py_ssize_t __pyx_t_4;
  Py_UCS4 __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  char *__pyx_t_7;
  if (__pyx_v_buffer == NULL) {
    PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
    return -1;
  }
  __Pyx_RefNannySetupContext("__getbuffer__", 0);
  __pyx_v_buffer->obj = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(__pyx_v_buffer->obj);

  /* "pyarrow/array.pxi":835
 * 
 *     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":836
 *     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":837
 *         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":838
 *         pep3118_format = self.type.pep3118_format
 *         if pep3118_format is None:
 *             raise NotImplementedError("type %s not supported for buffer "             # <<<<<<<<<<<<<<
 *                                       "protocol" % (self.type,))
 *         buffer.format = pep3118_format
 */
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 838, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = 0;
    __pyx_t_5 = 127;
    __Pyx_INCREF(__pyx_kp_u_type_2);
    __pyx_t_4 += 5;
    __Pyx_GIVEREF(__pyx_kp_u_type_2);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_type_2);

    /* "pyarrow/array.pxi":839
 *         if pep3118_format is None:
 *             raise NotImplementedError("type %s not supported for buffer "
 *                                       "protocol" % (self.type,))             # <<<<<<<<<<<<<<
 *         buffer.format = pep3118_format
 *         buffer.itemsize = self.type.bit_width // 8
 */
    __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(((PyObject *)__pyx_v_self->type)), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 839, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_5;
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_INCREF(__pyx_kp_u_not_supported_for_buffer_protoc);
    __pyx_t_4 += 34;
    __Pyx_GIVEREF(__pyx_kp_u_not_supported_for_buffer_protoc);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_not_supported_for_buffer_protoc);

    /* "pyarrow/array.pxi":838
 *         pep3118_format = self.type.pep3118_format
 *         if pep3118_format is None:
 *             raise NotImplementedError("type %s not supported for buffer "             # <<<<<<<<<<<<<<
 *                                       "protocol" % (self.type,))
 *         buffer.format = pep3118_format
 */
    __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 838, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 838, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(1, 838, __pyx_L1_error)

    /* "pyarrow/array.pxi":837
 *         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":840
 *             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(1, 840, __pyx_L1_error)
  }
  __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_pep3118_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 840, __pyx_L1_error)
  __pyx_v_buffer->format = __pyx_t_7;

  /* "pyarrow/array.pxi":841
 *                                       "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(1, 841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyInt_FloorDivideObjC(__pyx_t_1, __pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 841, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_buffer->itemsize = __pyx_t_4;

  /* "pyarrow/array.pxi":842
 *         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":843
 *         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":844
 *         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":845
 *         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":846
 *         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":847
 *         buffer.obj = self
 *         if self.tp.is_mutable():
 *             buffer.readonly = 0             # <<<<<<<<<<<<<<
 *         else:
 *             buffer.readonly = 1
 */
    __pyx_v_buffer->readonly = 0;

    /* "pyarrow/array.pxi":846
 *         buffer.ndim = self.tp.ndim()
 *         buffer.obj = self
 *         if self.tp.is_mutable():             # <<<<<<<<<<<<<<
 *             buffer.readonly = 0
 *         else:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/array.pxi":849
 *             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":852
 *         # 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":853
 *         # 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":854
 *         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":834
 *         return tuple(self.tp.strides())
 * 
 *     def __getbuffer__(self, cp.Py_buffer* buffer, int flags):             # <<<<<<<<<<<<<<
 *         buffer.buf = <char *> self.tp.data().get().data()
 *         pep3118_format = self.type.pep3118_format
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.Tensor.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  if (__pyx_v_buffer->obj != NULL) {
    __Pyx_GOTREF(__pyx_v_buffer->obj);
    __Pyx_DECREF(__pyx_v_buffer->obj); __pyx_v_buffer->obj = 0;
  }
  goto __pyx_L2;
  __pyx_L0:;
  if (__pyx_v_buffer->obj == Py_None) {
    __Pyx_GOTREF(__pyx_v_buffer->obj);
    __Pyx_DECREF(__pyx_v_buffer->obj); __pyx_v_buffer->obj = 0;
  }
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_pep3118_format);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/lib.pxd":210
 * 
 *     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__120, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__121, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":857
 * 
 * 
 * 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":858
 * 
 * cdef wrap_array_output(PyObject* output):
 *     cdef object obj = PyObject_to_object(output)             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(obj, dict):
 */
  __pyx_t_1 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_output); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_obj = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":860
 *     cdef object obj = PyObject_to_object(output)
 * 
 *     if isinstance(obj, dict):             # <<<<<<<<<<<<<<
 *         return pandas_api.categorical_type(obj['indices'],
 *                                            categories=obj['dictionary'],
 */
  __pyx_t_2 = PyDict_Check(__pyx_v_obj); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/array.pxi":861
 * 
 *     if isinstance(obj, dict):
 *         return pandas_api.categorical_type(obj['indices'],             # <<<<<<<<<<<<<<
 *                                            categories=obj['dictionary'],
 *                                            ordered=obj['ordered'],
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_7pyarrow_3lib_pandas_api), __pyx_n_s_categorical_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 861, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_u_indices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 861, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 861, __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":862
 *     if isinstance(obj, dict):
 *         return pandas_api.categorical_type(obj['indices'],
 *                                            categories=obj['dictionary'],             # <<<<<<<<<<<<<<
 *                                            ordered=obj['ordered'],
 *                                            fastpath=True)
 */
    __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 862, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_u_dictionary); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 862, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_categories, __pyx_t_6) < 0) __PYX_ERR(1, 862, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/array.pxi":863
 *         return pandas_api.categorical_type(obj['indices'],
 *                                            categories=obj['dictionary'],
 *                                            ordered=obj['ordered'],             # <<<<<<<<<<<<<<
 *                                            fastpath=True)
 *     else:
 */
    __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_u_ordered); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_ordered, __pyx_t_6) < 0) __PYX_ERR(1, 862, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/array.pxi":864
 *                                            categories=obj['dictionary'],
 *                                            ordered=obj['ordered'],
 *                                            fastpath=True)             # <<<<<<<<<<<<<<
 *     else:
 *         return obj
 */
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_fastpath, Py_True) < 0) __PYX_ERR(1, 862, __pyx_L1_error)

    /* "pyarrow/array.pxi":861
 * 
 *     if isinstance(obj, dict):
 *         return pandas_api.categorical_type(obj['indices'],             # <<<<<<<<<<<<<<
 *                                            categories=obj['dictionary'],
 *                                            ordered=obj['ordered'],
 */
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 861, __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":860
 *     cdef object obj = PyObject_to_object(output)
 * 
 *     if isinstance(obj, dict):             # <<<<<<<<<<<<<<
 *         return pandas_api.categorical_type(obj['indices'],
 *                                            categories=obj['dictionary'],
 */
  }

  /* "pyarrow/array.pxi":866
 *                                            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":857
 * 
 * 
 * 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":1013
 * 
 *     @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(1, 1013, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pool);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_arrays") < 0)) __PYX_ERR(1, 1013, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_offsets = values[0];
    __pyx_v_values = values[1];
    __pyx_v_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_arrays", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1013, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.ListArray.from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "pool", 0))) __PYX_ERR(1, 1013, __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":1029
 *             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":1031
 *         cdef CMemoryPool* cpool = maybe_unbox_memory_pool(pool)
 * 
 *         _offsets = asarray(offsets, type='int32')             # <<<<<<<<<<<<<<
 *         _values = asarray(values)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_offsets);
  __Pyx_GIVEREF(__pyx_v_offsets);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_offsets);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_type, __pyx_n_u_int32) < 0) __PYX_ERR(1, 1031, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1031, __pyx_L1_error)
  __pyx_v__offsets = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1032
 * 
 *         _offsets = asarray(offsets, type='int32')
 *         _values = asarray(values)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1032, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_values) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_values);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1032, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1032, __pyx_L1_error)
  __pyx_v__values = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1034
 *         _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":1035
 * 
 *         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(1, 1035, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":1034
 *         _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":1037
 *             check_status(CListArray.FromArrays(_offsets.ap[0], _values.ap[0],
 *                                                cpool, &out))
 *         return pyarrow_wrap_array(out)             # <<<<<<<<<<<<<<
 * 
 *     def flatten(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_out); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1037, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1013
 * 
 *     @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":1039
 *         return pyarrow_wrap_array(out)
 * 
 *     def flatten(self):             # <<<<<<<<<<<<<<
 *         """
 *         Unnest this ListArray by one level
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9ListArray_3flatten(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9ListArray_2flatten[] = "ListArray.flatten(self)\n\n        Unnest this ListArray by one level\n\n        Returns\n        -------\n        result : Array\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_9ListArray_3flatten(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flatten (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9ListArray_2flatten(((struct __pyx_obj_7pyarrow_3lib_ListArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_9ListArray_2flatten(struct __pyx_obj_7pyarrow_3lib_ListArray *__pyx_v_self) {
   arrow::ListArray *__pyx_v_arr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("flatten", 0);

  /* "pyarrow/array.pxi":1047
 *         result : Array
 *         """
 *         cdef CListArray* arr = <CListArray*> self.ap             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_array(arr.values())
 * 
 */
  __pyx_v_arr = (( arrow::ListArray *)__pyx_v_self->__pyx_base.ap);

  /* "pyarrow/array.pxi":1048
 *         """
 *         cdef CListArray* arr = <CListArray*> self.ap
 *         return pyarrow_wrap_array(arr.values())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_arr->values()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1039
 *         return pyarrow_wrap_array(out)
 * 
 *     def flatten(self):             # <<<<<<<<<<<<<<
 *         """
 *         Unnest this ListArray by one level
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.ListArray.flatten", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1057
 * 
 *     @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(1, 1057, __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(1, 1057, __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(1, 1057, __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(1, 1057, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.UnionArray.from_dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_types), __pyx_ptype_7pyarrow_3lib_Array, 1, "types", 0))) __PYX_ERR(1, 1057, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value_offsets), __pyx_ptype_7pyarrow_3lib_Array, 1, "value_offsets", 0))) __PYX_ERR(1, 1057, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_children), (&PyList_Type), 1, "children", 1))) __PYX_ERR(1, 1057, __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":1075
 *         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(1, 1075, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_children; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 1075, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1075, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1075, __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":1076
 *         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(1, 1076, __pyx_L1_error)
    }

    /* "pyarrow/array.pxi":1075
 *         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":1077
 *         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":1078
 *             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(1, 1078, __pyx_L6_error)
      }

      /* "pyarrow/array.pxi":1077
 *         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":1080
 *             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(1, 1080, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1057
 * 
 *     @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":1083
 * 
 *     @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(1, 1083, __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(1, 1083, __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(1, 1083, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.UnionArray.from_sparse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_types), __pyx_ptype_7pyarrow_3lib_Array, 1, "types", 0))) __PYX_ERR(1, 1083, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_children), (&PyList_Type), 1, "children", 1))) __PYX_ERR(1, 1083, __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":1100
 *         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(1, 1100, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_children; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 1100, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1100, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1100, __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":1101
 *         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(1, 1101, __pyx_L1_error)
    }

    /* "pyarrow/array.pxi":1100
 *         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":1102
 *         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":1103
 *             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(1, 1103, __pyx_L6_error)
      }

      /* "pyarrow/array.pxi":1102
 *         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":1104
 *         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(1, 1104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1083
 * 
 *     @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":1113
 * 
 *     @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":1114
 *     @staticmethod
 *     def from_buffers(int length, Buffer value_offsets, Buffer data,
 *                      Buffer null_bitmap=None, int null_count=-1,             # <<<<<<<<<<<<<<
 *                      int offset=0):
 *         """
 */
    values[3] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_Buffer *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_length)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value_offsets)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_buffers", 0, 3, 6, 1); __PYX_ERR(1, 1113, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_buffers", 0, 3, 6, 2); __PYX_ERR(1, 1113, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_null_bitmap);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_null_count);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_buffers") < 0)) __PYX_ERR(1, 1113, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_length = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_length == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1113, __pyx_L3_error)
    __pyx_v_value_offsets = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)values[1]);
    __pyx_v_data = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)values[2]);
    __pyx_v_null_bitmap = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)values[3]);
    if (values[4]) {
      __pyx_v_null_count = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_null_count == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1114, __pyx_L3_error)
    } else {
      __pyx_v_null_count = ((int)-1);
    }
    if (values[5]) {
      __pyx_v_offset = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1115, __pyx_L3_error)
    } else {
      __pyx_v_offset = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_buffers", 0, 3, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1113, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.StringArray.from_buffers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value_offsets), __pyx_ptype_7pyarrow_3lib_Buffer, 1, "value_offsets", 0))) __PYX_ERR(1, 1113, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_7pyarrow_3lib_Buffer, 1, "data", 0))) __PYX_ERR(1, 1113, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_null_bitmap), __pyx_ptype_7pyarrow_3lib_Buffer, 1, "null_bitmap", 0))) __PYX_ERR(1, 1114, __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":1113
 * 
 *     @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":1137
 *         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":1138
 * 
 *         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":1137
 *         cdef shared_ptr[CArray] out
 * 
 *         if null_bitmap is not None:             # <<<<<<<<<<<<<<
 *             c_null_bitmap = null_bitmap.buffer
 *         else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/array.pxi":1140
 *             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":1142
 *             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":1145
 *             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(1, 1145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1113
 * 
 *     @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":1159
 *     """
 * 
 *     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":1160
 * 
 *     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":1159
 *     """
 * 
 *     def dictionary_encode(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1163
 * 
 *     @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":1164
 *     @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":1166
 *         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":1167
 * 
 *         if self._dictionary is None:
 *             self._dictionary = pyarrow_wrap_array(darr.dictionary())             # <<<<<<<<<<<<<<
 * 
 *         return self._dictionary
 */
    __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_darr->dictionary()); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1167, __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":1166
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.ap)
 * 
 *         if self._dictionary is None:             # <<<<<<<<<<<<<<
 *             self._dictionary = pyarrow_wrap_array(darr.dictionary())
 * 
 */
  }

  /* "pyarrow/array.pxi":1169
 *             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":1163
 * 
 *     @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":1172
 * 
 *     @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":1173
 *     @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":1175
 *         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":1176
 * 
 *         if self._indices is None:
 *             self._indices = pyarrow_wrap_array(darr.indices())             # <<<<<<<<<<<<<<
 * 
 *         return self._indices
 */
    __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_darr->indices()); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1176, __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":1175
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.ap)
 * 
 *         if self._indices is None:             # <<<<<<<<<<<<<<
 *             self._indices = pyarrow_wrap_array(darr.indices())
 * 
 */
  }

  /* "pyarrow/array.pxi":1178
 *             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":1172
 * 
 *     @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":1181
 * 
 *     @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":1183
 *     def from_arrays(indices, dictionary, mask=None, bint ordered=False,
 *                     bint from_pandas=False, bint safe=True,
 *                     MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct Arrow DictionaryArray from array of indices (must be
 */
    values[6] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dictionary)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_arrays", 0, 2, 7, 1); __PYX_ERR(1, 1181, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mask);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ordered);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_from_pandas);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_safe);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[6] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_arrays") < 0)) __PYX_ERR(1, 1181, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_indices = values[0];
    __pyx_v_dictionary = values[1];
    __pyx_v_mask = values[2];
    if (values[3]) {
      __pyx_v_ordered = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_ordered == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1181, __pyx_L3_error)
    } else {

      /* "pyarrow/array.pxi":1181
 * 
 *     @staticmethod
 *     def from_arrays(indices, dictionary, mask=None, bint ordered=False,             # <<<<<<<<<<<<<<
 *                     bint from_pandas=False, bint safe=True,
 *                     MemoryPool memory_pool=None):
 */
      __pyx_v_ordered = ((int)0);
    }
    if (values[4]) {
      __pyx_v_from_pandas = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_from_pandas == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1182, __pyx_L3_error)
    } else {

      /* "pyarrow/array.pxi":1182
 *     @staticmethod
 *     def from_arrays(indices, dictionary, mask=None, bint ordered=False,
 *                     bint from_pandas=False, bint safe=True,             # <<<<<<<<<<<<<<
 *                     MemoryPool memory_pool=None):
 *         """
 */
      __pyx_v_from_pandas = ((int)0);
    }
    if (values[5]) {
      __pyx_v_safe = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_safe == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1182, __pyx_L3_error)
    } else {
      __pyx_v_safe = ((int)1);
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[6]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_arrays", 0, 2, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1181, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.DictionaryArray.from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(1, 1183, __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":1181
 * 
 *     @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":1213
 *             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":1214
 * 
 *         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":1215
 *         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__122, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1215, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(1, 1215, __pyx_L1_error)

      /* "pyarrow/array.pxi":1214
 * 
 *         if isinstance(indices, Array):
 *             if mask is not None:             # <<<<<<<<<<<<<<
 *                 raise NotImplementedError(
 *                     "mask not implemented with Arrow array inputs yet")
 */
    }

    /* "pyarrow/array.pxi":1217
 *                 raise NotImplementedError(
 *                     "mask not implemented with Arrow array inputs yet")
 *             _indices = indices             # <<<<<<<<<<<<<<
 *         else:
 *             if from_pandas:
 */
    if (!(likely(((__pyx_v_indices) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_indices, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1217, __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":1213
 *             shared_ptr[CArray] c_result
 * 
 *         if isinstance(indices, Array):             # <<<<<<<<<<<<<<
 *             if mask is not None:
 *                 raise NotImplementedError(
 */
    goto __pyx_L3;
  }

  /* "pyarrow/array.pxi":1219
 *             _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":1220
 *         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":1221
 *             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(1, 1221, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF_SET(__pyx_v_mask, __pyx_t_3);
        __pyx_t_3 = 0;

        /* "pyarrow/array.pxi":1220
 *         else:
 *             if from_pandas:
 *                 if mask is None:             # <<<<<<<<<<<<<<
 *                     mask = indices == -1
 *                 else:
 */
        goto __pyx_L6;
      }

      /* "pyarrow/array.pxi":1223
 *                     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(1, 1223, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyNumber_Or(__pyx_v_mask, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1223, __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":1219
 *             _indices = indices
 *         else:
 *             if from_pandas:             # <<<<<<<<<<<<<<
 *                 if mask is None:
 *                     mask = indices == -1
 */
    }

    /* "pyarrow/array.pxi":1224
 *                 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(1, 1224, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1224, __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(1, 1224, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_mask, __pyx_v_mask) < 0) __PYX_ERR(1, 1224, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_memory_pool, ((PyObject *)__pyx_v_memory_pool)) < 0) __PYX_ERR(1, 1224, __pyx_L1_error)
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1224, __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(1, 1224, __pyx_L1_error)
    __pyx_v__indices = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_6);
    __pyx_t_6 = 0;
  }
  __pyx_L3:;

  /* "pyarrow/array.pxi":1226
 *             _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":1227
 * 
 *         if isinstance(dictionary, Array):
 *             _dictionary = dictionary             # <<<<<<<<<<<<<<
 *         else:
 *             _dictionary = array(dictionary, memory_pool=memory_pool)
 */
    if (!(likely(((__pyx_v_dictionary) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dictionary, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1227, __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":1226
 *             _indices = array(indices, mask=mask, memory_pool=memory_pool)
 * 
 *         if isinstance(dictionary, Array):             # <<<<<<<<<<<<<<
 *             _dictionary = dictionary
 *         else:
 */
    goto __pyx_L7;
  }

  /* "pyarrow/array.pxi":1229
 *             _dictionary = dictionary
 *         else:
 *             _dictionary = array(dictionary, memory_pool=memory_pool)             # <<<<<<<<<<<<<<
 * 
 *         if not isinstance(_indices, IntegerArray):
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1229, __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(1, 1229, __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(1, 1229, __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(1, 1229, __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(1, 1229, __pyx_L1_error)
    __pyx_v__dictionary = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_4);
    __pyx_t_4 = 0;
  }
  __pyx_L7:;

  /* "pyarrow/array.pxi":1231
 *             _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":1232
 * 
 *         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__123, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1232, __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, 1232, __pyx_L1_error)

    /* "pyarrow/array.pxi":1231
 *             _dictionary = array(dictionary, memory_pool=memory_pool)
 * 
 *         if not isinstance(_indices, IntegerArray):             # <<<<<<<<<<<<<<
 *             raise ValueError('Indices must be integer type')
 * 
 */
  }

  /* "pyarrow/array.pxi":1234
 *             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":1236
 *         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":1239
 *                                          _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":1240
 * 
 *         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":1241
 *         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(1, 1241, __pyx_L11_error)
        }

        /* "pyarrow/array.pxi":1240
 * 
 *         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":1239
 *                                          _dictionary.sp_array, c_ordered))
 * 
 *         if safe:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(
 */
    goto __pyx_L9;
  }

  /* "pyarrow/array.pxi":1245
 *                                                 &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":1247
 *             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(1, 1247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1181
 * 
 *     @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":1255
 *     """
 * 
 *     def field(self, index):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieves the child array belonging to field
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11StructArray_1field(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11StructArray_field[] = "StructArray.field(self, index)\n\n        Retrieves the child array belonging to field\n\n        Parameters\n        ----------\n        index : Union[int, str]\n            Index / position or name of the field\n\n        Returns\n        -------\n        result : Array\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11StructArray_1field(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("field (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11StructArray_field(((struct __pyx_obj_7pyarrow_3lib_StructArray *)__pyx_v_self), ((PyObject *)__pyx_v_index));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11StructArray_field(struct __pyx_obj_7pyarrow_3lib_StructArray *__pyx_v_self, PyObject *__pyx_v_index) {
   arrow::StructArray *__pyx_v_arr;
  std::shared_ptr< arrow::Array>  __pyx_v_child;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("field", 0);

  /* "pyarrow/array.pxi":1269
 *         """
 *         cdef:
 *             CStructArray* arr = <CStructArray*> self.ap             # <<<<<<<<<<<<<<
 *             shared_ptr[CArray] child
 * 
 */
  __pyx_v_arr = (( arrow::StructArray *)__pyx_v_self->__pyx_base.ap);

  /* "pyarrow/array.pxi":1272
 *             shared_ptr[CArray] child
 * 
 *         if isinstance(index, six.string_types):             # <<<<<<<<<<<<<<
 *             child = arr.GetFieldByName(tobytes(index))
 *             if child == nullptr:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_six); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_string_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_index, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1272, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/array.pxi":1273
 * 
 *         if isinstance(index, six.string_types):
 *             child = arr.GetFieldByName(tobytes(index))             # <<<<<<<<<<<<<<
 *             if child == nullptr:
 *                 raise KeyError(index)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1273, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v_index) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_index);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1273, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1273, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_child = __pyx_v_arr->GetFieldByName(__pyx_t_6);

    /* "pyarrow/array.pxi":1274
 *         if isinstance(index, six.string_types):
 *             child = arr.GetFieldByName(tobytes(index))
 *             if child == nullptr:             # <<<<<<<<<<<<<<
 *                 raise KeyError(index)
 *         elif isinstance(index, six.integer_types):
 */
    __pyx_t_4 = ((__pyx_v_child == nullptr) != 0);
    if (unlikely(__pyx_t_4)) {

      /* "pyarrow/array.pxi":1275
 *             child = arr.GetFieldByName(tobytes(index))
 *             if child == nullptr:
 *                 raise KeyError(index)             # <<<<<<<<<<<<<<
 *         elif isinstance(index, six.integer_types):
 *             child = arr.field(
 */
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1275, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(1, 1275, __pyx_L1_error)

      /* "pyarrow/array.pxi":1274
 *         if isinstance(index, six.string_types):
 *             child = arr.GetFieldByName(tobytes(index))
 *             if child == nullptr:             # <<<<<<<<<<<<<<
 *                 raise KeyError(index)
 *         elif isinstance(index, six.integer_types):
 */
    }

    /* "pyarrow/array.pxi":1272
 *             shared_ptr[CArray] child
 * 
 *         if isinstance(index, six.string_types):             # <<<<<<<<<<<<<<
 *             child = arr.GetFieldByName(tobytes(index))
 *             if child == nullptr:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/array.pxi":1276
 *             if child == nullptr:
 *                 raise KeyError(index)
 *         elif isinstance(index, six.integer_types):             # <<<<<<<<<<<<<<
 *             child = arr.field(
 *                 <int>_normalize_index(index, self.ap.num_fields()))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_six); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_integer_types); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = PyObject_IsInstance(__pyx_v_index, __pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1276, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (likely(__pyx_t_3)) {

    /* "pyarrow/array.pxi":1278
 *         elif isinstance(index, six.integer_types):
 *             child = arr.field(
 *                 <int>_normalize_index(index, self.ap.num_fields()))             # <<<<<<<<<<<<<<
 *         else:
 *             raise TypeError('Expected integer or string index')
 */
    __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1278, __pyx_L1_error)
    __pyx_t_8 = __pyx_f_7pyarrow_3lib__normalize_index(__pyx_t_7, __pyx_v_self->__pyx_base.ap->num_fields()); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1L))) __PYX_ERR(1, 1278, __pyx_L1_error)

    /* "pyarrow/array.pxi":1277
 *                 raise KeyError(index)
 *         elif isinstance(index, six.integer_types):
 *             child = arr.field(             # <<<<<<<<<<<<<<
 *                 <int>_normalize_index(index, self.ap.num_fields()))
 *         else:
 */
    __pyx_v_child = __pyx_v_arr->field(((int)__pyx_t_8));

    /* "pyarrow/array.pxi":1276
 *             if child == nullptr:
 *                 raise KeyError(index)
 *         elif isinstance(index, six.integer_types):             # <<<<<<<<<<<<<<
 *             child = arr.field(
 *                 <int>_normalize_index(index, self.ap.num_fields()))
 */
    goto __pyx_L3;
  }

  /* "pyarrow/array.pxi":1280
 *                 <int>_normalize_index(index, self.ap.num_fields()))
 *         else:
 *             raise TypeError('Expected integer or string index')             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_array(child)
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1280, __pyx_L1_error)
    __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, 1280, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/array.pxi":1282
 *             raise TypeError('Expected integer or string index')
 * 
 *         return pyarrow_wrap_array(child)             # <<<<<<<<<<<<<<
 * 
 *     def flatten(self, MemoryPool memory_pool=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_child); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1282, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1255
 *     """
 * 
 *     def field(self, index):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieves the child array belonging to field
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.StructArray.field", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1284
 *         return pyarrow_wrap_array(child)
 * 
 *     def flatten(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Flatten this StructArray, returning one individual array for each
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11StructArray_3flatten(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11StructArray_2flatten[] = "StructArray.flatten(self, MemoryPool memory_pool=None)\n\n        Flatten this StructArray, returning one individual array for each\n        field in the struct.\n\n        Parameters\n        ----------\n        memory_pool : MemoryPool, default None\n            For memory allocations, if required, otherwise use default pool\n\n        Returns\n        -------\n        result : List[Array]\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11StructArray_3flatten(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flatten (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_memory_pool,0};
    PyObject* values[1] = {0};
    values[0] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "flatten") < 0)) __PYX_ERR(1, 1284, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("flatten", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1284, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.StructArray.flatten", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(1, 1284, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_11StructArray_2flatten(((struct __pyx_obj_7pyarrow_3lib_StructArray *)__pyx_v_self), __pyx_v_memory_pool);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11StructArray_2flatten(struct __pyx_obj_7pyarrow_3lib_StructArray *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
  std::vector<std::shared_ptr< arrow::Array> >  __pyx_v_arrays;
   arrow::MemoryPool *__pyx_v_pool;
   arrow::StructArray *__pyx_v_sarr;
  std::shared_ptr< arrow::Array>  __pyx_8genexpr6__pyx_v_arr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  std::vector<std::shared_ptr< arrow::Array> > ::iterator __pyx_t_3;
  std::shared_ptr< arrow::Array>  __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("flatten", 0);

  /* "pyarrow/array.pxi":1300
 *         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":1301
 *             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":1303
 *             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":1304
 * 
 *         with nogil:
 *             check_status(sarr.Flatten(pool, &arrays))             # <<<<<<<<<<<<<<
 * 
 *         return [pyarrow_wrap_array(arr) for arr in arrays]
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_sarr->Flatten(__pyx_v_pool, (&__pyx_v_arrays))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1304, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":1303
 *             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":1306
 *             check_status(sarr.Flatten(pool, &arrays))
 * 
 *         return [pyarrow_wrap_array(arr) for arr in arrays]             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_v_arrays.begin();
    for (;;) {
      if (!(__pyx_t_3 != __pyx_v_arrays.end())) break;
      __pyx_t_4 = *__pyx_t_3;
      ++__pyx_t_3;
      __pyx_8genexpr6__pyx_v_arr = __pyx_t_4;
      __pyx_t_5 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_8genexpr6__pyx_v_arr); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1306, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 1306, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  } /* exit inner scope */
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1284
 *         return pyarrow_wrap_array(child)
 * 
 *     def flatten(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Flatten this StructArray, returning one individual array for each
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.StructArray.flatten", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1309
 * 
 *     @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(1, 1309, __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(1, 1309, __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_8genexpr7__pyx_v_x = NULL;
  PyObject *__pyx_8genexpr8__pyx_v_name = NULL;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_8genexpr8__pyx_v_array = 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":1334
 *             DataType struct_type
 * 
 *         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":1335
 * 
 *         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__124, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1335, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(1, 1335, __pyx_L1_error)

    /* "pyarrow/array.pxi":1334
 *             DataType struct_type
 * 
 *         if names is None:             # <<<<<<<<<<<<<<
 *             raise ValueError('Names are currently required')
 * 
 */
  }

  /* "pyarrow/array.pxi":1337
 *             raise ValueError('Names are currently required')
 * 
 *         arrays = [asarray(x) for x in arrays]             # <<<<<<<<<<<<<<
 * 
 *         num_arrays = len(arrays)
 */
  { /* enter inner scope */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1337, __pyx_L6_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(1, 1337, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1337, __pyx_L6_error)
    }
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 1337, __pyx_L6_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1337, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        } else {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 1337, __pyx_L6_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1337, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        }
      } else {
        __pyx_t_7 = __pyx_t_6(__pyx_t_4);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(1, 1337, __pyx_L6_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr7__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(1, 1337, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      __pyx_t_7 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_8genexpr7__pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_8genexpr7__pyx_v_x);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1337, __pyx_L6_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(1, 1337, __pyx_L6_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_x); __pyx_8genexpr7__pyx_v_x = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L6_error:;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_x); __pyx_8genexpr7__pyx_v_x = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __Pyx_DECREF_SET(__pyx_v_arrays, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyarrow/array.pxi":1339
 *         arrays = [asarray(x) for x in arrays]
 * 
 *         num_arrays = len(arrays)             # <<<<<<<<<<<<<<
 *         if num_arrays != len(names):
 *             raise ValueError("The number of names should be equal to the "
 */
  __pyx_t_5 = PyObject_Length(__pyx_v_arrays); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 1339, __pyx_L1_error)
  __pyx_v_num_arrays = __pyx_t_5;

  /* "pyarrow/array.pxi":1340
 * 
 *         num_arrays = len(arrays)
 *         if num_arrays != len(names):             # <<<<<<<<<<<<<<
 *             raise ValueError("The number of names should be equal to the "
 *                              "number of arrays")
 */
  __pyx_t_5 = PyObject_Length(__pyx_v_names); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 1340, __pyx_L1_error)
  __pyx_t_2 = ((__pyx_v_num_arrays != __pyx_t_5) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/array.pxi":1341
 *         num_arrays = len(arrays)
 *         if num_arrays != len(names):
 *             raise ValueError("The number of names should be equal to the "             # <<<<<<<<<<<<<<
 *                              "number of arrays")
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__125, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(1, 1341, __pyx_L1_error)

    /* "pyarrow/array.pxi":1340
 * 
 *         num_arrays = len(arrays)
 *         if num_arrays != len(names):             # <<<<<<<<<<<<<<
 *             raise ValueError("The number of names should be equal to the "
 *                              "number of arrays")
 */
  }

  /* "pyarrow/array.pxi":1344
 *                              "number of arrays")
 * 
 *         if num_arrays > 0:             # <<<<<<<<<<<<<<
 *             length = len(arrays[0])
 *             c_arrays.resize(num_arrays)
 */
  __pyx_t_2 = ((__pyx_v_num_arrays > 0) != 0);
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":1345
 * 
 *         if num_arrays > 0:
 *             length = len(arrays[0])             # <<<<<<<<<<<<<<
 *             c_arrays.resize(num_arrays)
 *             for i in range(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(1, 1345, __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(1, 1345, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_length = __pyx_t_5;

    /* "pyarrow/array.pxi":1346
 *         if num_arrays > 0:
 *             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(1, 1346, __pyx_L1_error)
    }

    /* "pyarrow/array.pxi":1347
 *             length = len(arrays[0])
 *             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":1348
 *             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(1, 1348, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1348, __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":1349
 *             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(1, 1349, __pyx_L1_error)
      __pyx_t_2 = ((__pyx_t_5 != __pyx_v_length) != 0);
      if (unlikely(__pyx_t_2)) {

        /* "pyarrow/array.pxi":1350
 *                 array = arrays[i]
 *                 if len(array) != length:
 *                     raise ValueError("All arrays must have the same length")             # <<<<<<<<<<<<<<
 *                 c_arrays[i] = array.sp_array
 *         else:
 */
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__126, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1350, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __PYX_ERR(1, 1350, __pyx_L1_error)

        /* "pyarrow/array.pxi":1349
 *             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":1351
 *                 if len(array) != length:
 *                     raise ValueError("All arrays must have the same length")
 *                 c_arrays[i] = array.sp_array             # <<<<<<<<<<<<<<
 *         else:
 *             length = 0
 */
      __pyx_t_13 = __pyx_v_array->sp_array;
      (__pyx_v_c_arrays[__pyx_v_i]) = __pyx_t_13;
    }

    /* "pyarrow/array.pxi":1344
 *                              "number of arrays")
 * 
 *         if num_arrays > 0:             # <<<<<<<<<<<<<<
 *             length = len(arrays[0])
 *             c_arrays.resize(num_arrays)
 */
    goto __pyx_L11;
  }

  /* "pyarrow/array.pxi":1353
 *                 c_arrays[i] = array.sp_array
 *         else:
 *             length = 0             # <<<<<<<<<<<<<<
 * 
 *         struct_type = struct([
 */
  /*else*/ {
    __pyx_v_length = 0;
  }
  __pyx_L11:;

  /* "pyarrow/array.pxi":1355
 *             length = 0
 * 
 *         struct_type = struct([             # <<<<<<<<<<<<<<
 *             field(name, array.type) for name, array in zip(names, arrays)
 *         ])
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_struct); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  { /* enter inner scope */
    __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1355, __pyx_L17_error)
    __Pyx_GOTREF(__pyx_t_7);

    /* "pyarrow/array.pxi":1356
 * 
 *         struct_type = struct([
 *             field(name, array.type) for name, array in zip(names, arrays)             # <<<<<<<<<<<<<<
 *         ])
 * 
 */
    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1356, __pyx_L17_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(1, 1356, __pyx_L17_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(1, 1356, __pyx_L17_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_6 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1356, __pyx_L17_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(1, 1356, __pyx_L17_error)
          #else
          __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1356, __pyx_L17_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(1, 1356, __pyx_L17_error)
          #else
          __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1356, __pyx_L17_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(1, 1356, __pyx_L17_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(1, 1356, __pyx_L17_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(1, 1356, __pyx_L17_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_15 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 1356, __pyx_L17_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(1, 1356, __pyx_L17_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_L20_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_L20_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_15);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_16), 2) < 0) __PYX_ERR(1, 1356, __pyx_L17_error)
        __pyx_t_17 = NULL;
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        goto __pyx_L21_unpacking_done;
        __pyx_L20_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        __pyx_t_17 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(1, 1356, __pyx_L17_error)
        __pyx_L21_unpacking_done:;
      }
      if (!(likely(((__pyx_t_15) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_15, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1356, __pyx_L17_error)
      __Pyx_XDECREF_SET(__pyx_8genexpr8__pyx_v_name, __pyx_t_14);
      __pyx_t_14 = 0;
      __Pyx_XDECREF_SET(__pyx_8genexpr8__pyx_v_array, ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_15));
      __pyx_t_15 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_field); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 1356, __pyx_L17_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_8genexpr8__pyx_v_name, ((PyObject *)__pyx_8genexpr8__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(1, 1356, __pyx_L17_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_8genexpr8__pyx_v_name, ((PyObject *)__pyx_8genexpr8__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(1, 1356, __pyx_L17_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(1, 1356, __pyx_L17_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_8genexpr8__pyx_v_name);
        __Pyx_GIVEREF(__pyx_8genexpr8__pyx_v_name);
        PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_18, __pyx_8genexpr8__pyx_v_name);
        __Pyx_INCREF(((PyObject *)__pyx_8genexpr8__pyx_v_array->type));
        __Pyx_GIVEREF(((PyObject *)__pyx_8genexpr8__pyx_v_array->type));
        PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_18, ((PyObject *)__pyx_8genexpr8__pyx_v_array->type));
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_16, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1356, __pyx_L17_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(1, 1355, __pyx_L17_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF((PyObject *)__pyx_8genexpr8__pyx_v_array); __pyx_8genexpr8__pyx_v_array = 0;
    __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_name); __pyx_8genexpr8__pyx_v_name = 0;
    goto __pyx_L22_exit_scope;
    __pyx_L17_error:;
    __Pyx_XDECREF((PyObject *)__pyx_8genexpr8__pyx_v_array); __pyx_8genexpr8__pyx_v_array = 0;
    __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_name); __pyx_8genexpr8__pyx_v_name = 0;
    goto __pyx_L1_error;
    __pyx_L22_exit_scope:;
  } /* exit inner scope */
  __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(1, 1355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1355
 *             length = 0
 * 
 *         struct_type = struct([             # <<<<<<<<<<<<<<
 *             field(name, array.type) for name, array in zip(names, arrays)
 *         ])
 */
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(1, 1355, __pyx_L1_error)
  __pyx_v_struct_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyarrow/array.pxi":1359
 *         ])
 * 
 *         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":1361
 *         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(1, 1361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1309
 * 
 *     @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_8genexpr7__pyx_v_x);
  __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_name);
  __Pyx_XDECREF((PyObject *)__pyx_8genexpr8__pyx_v_array);
  __Pyx_XDECREF(__pyx_v_arrays);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1394
 * 
 * 
 * cdef object get_series_values(object obj):             # <<<<<<<<<<<<<<
 *     if pandas_api.is_series(obj):
 *         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;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("get_series_values", 0);

  /* "pyarrow/array.pxi":1395
 * 
 * cdef object get_series_values(object obj):
 *     if pandas_api.is_series(obj):             # <<<<<<<<<<<<<<
 *         result = obj.values
 *     elif isinstance(obj, np.ndarray):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib__PandasAPIShim *)__pyx_v_7pyarrow_3lib_pandas_api->__pyx_vtab)->is_series(__pyx_v_7pyarrow_3lib_pandas_api, __pyx_v_obj, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1395, __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(1, 1395, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":1396
 * cdef object get_series_values(object obj):
 *     if pandas_api.is_series(obj):
 *         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(1, 1396, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_result = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pyarrow/array.pxi":1395
 * 
 * cdef object get_series_values(object obj):
 *     if pandas_api.is_series(obj):             # <<<<<<<<<<<<<<
 *         result = obj.values
 *     elif isinstance(obj, np.ndarray):
 */
    goto __pyx_L3;
  }

  /* "pyarrow/array.pxi":1397
 *     if pandas_api.is_series(obj):
 *         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(1, 1397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 1397, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = (__pyx_t_2 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/array.pxi":1398
 *         result = obj.values
 *     elif isinstance(obj, np.ndarray):
 *         result = obj             # <<<<<<<<<<<<<<
 *     else:
 *         result = pandas_api.make_series(obj).values
 */
    __Pyx_INCREF(__pyx_v_obj);
    __pyx_v_result = __pyx_v_obj;

    /* "pyarrow/array.pxi":1397
 *     if pandas_api.is_series(obj):
 *         result = obj.values
 *     elif isinstance(obj, np.ndarray):             # <<<<<<<<<<<<<<
 *         result = obj
 *     else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/array.pxi":1400
 *         result = obj
 *     else:
 *         result = pandas_api.make_series(obj).values             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_7pyarrow_3lib_pandas_api), __pyx_n_s_make_series); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1400, __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_3 = (__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_3)) __PYX_ERR(1, 1400, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1400, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_result = __pyx_t_1;
    __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "pyarrow/array.pxi":1402
 *         result = pandas_api.make_series(obj).values
 * 
 *     return result             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1394
 * 
 * 
 * cdef object get_series_values(object obj):             # <<<<<<<<<<<<<<
 *     if pandas_api.is_series(obj):
 *         result = obj.values
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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__127, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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__128, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__129, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":27
 *     """
 * 
 *     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":28
 * 
 *     def __cinit__(self):
 *         self.chunked_array = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self):
 */
  __pyx_v_self->chunked_array = NULL;

  /* "pyarrow/table.pxi":27
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.chunked_array = NULL
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":30
 *         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":31
 * 
 *     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__130, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 31, __pyx_L1_error)
  __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, 31, __pyx_L1_error)

  /* "pyarrow/table.pxi":30
 *         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":34
 *                         "`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":35
 * 
 *     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":36
 *     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":34
 *                         "`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":38
 *         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":39
 * 
 *     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(12, 39, __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(12, 39, __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(12, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 39, __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(12, 39, __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":38
 *         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":42
 * 
 *     @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":43
 *     @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(12, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":42
 * 
 *     @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":45
 *         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":46
 * 
 *     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(12, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":45
 *         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":48
 *         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":49
 * 
 *     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(12, 49, __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, 49, __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(12, 49, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":48
 *         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":51
 *         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":52
 * 
 *     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(12, 52, __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(12, 52, __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":53
 *     def __repr__(self):
 *         type_format = object.__repr__(self)
 *         return '{0}\n{1}'.format(type_format, str(self))             # <<<<<<<<<<<<<<
 * 
 *     def format(self, int indent=0, int window=10):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_0_1, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 53, __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(12, 53, __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(12, 53, __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(12, 53, __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(12, 53, __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":51
 *         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":55
 *         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(12, 55, __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(12, 55, __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(12, 55, __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(12, 55, __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":59
 *             c_string result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(
 *                 PrettyPrint(
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":60
 * 
 *         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(12, 60, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":59
 *             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":68
 *             )
 * 
 *         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(12, 68, __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(12, 68, __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, 68, __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":55
 *         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":70
 *         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":71
 * 
 *     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(12, 71, __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, 71, __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":70
 *         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":74
 * 
 *     @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":82
 *         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(12, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":74
 * 
 *     @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":84
 *         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_6___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__ *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_6___iter__(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_6___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(12, 84, __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(12, 84, __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_6___iter__ *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___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(12, 84, __pyx_L1_error)

  /* "pyarrow/table.pxi":85
 * 
 *     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(12, 85, __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, 85, __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(12, 85, __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(12, 85, __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(12, 85, __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(12, 85, __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(12, 85, __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(12, 85, __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(12, 85, __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":86
 *     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(12, 86, __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(12, 86, __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(12, 86, __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(12, 86, __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(12, 86, __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(12, 86, __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(12, 86, __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":87
 *         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(12, 87, __pyx_L1_error)

      /* "pyarrow/table.pxi":86
 *     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":85
 * 
 *     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":84
 *         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":89
 *                 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":90
 * 
 *     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":91
 *     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(12, 91, __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(12, 91, __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(12, 91, __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(12, 91, __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(12, 91, __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":90
 * 
 *     def __getitem__(self, key):
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return _normalize_slice(self, key)
 *         elif isinstance(key, six.integer_types):
 */
  }

  /* "pyarrow/table.pxi":92
 *         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(12, 92, __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(12, 92, __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(12, 92, __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":93
 *             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(12, 93, __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(12, 93, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":92
 *         if isinstance(key, slice):
 *             return _normalize_slice(self, key)
 *         elif isinstance(key, six.integer_types):             # <<<<<<<<<<<<<<
 *             return self.getitem(key)
 *         else:
 */
  }

  /* "pyarrow/table.pxi":95
 *             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__131, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 95, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(12, 95, __pyx_L1_error)
  }

  /* "pyarrow/table.pxi":89
 *                 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":97
 *             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":100
 *         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(12, 100, __pyx_L1_error)
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_index = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":101
 * 
 *         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(12, 101, __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(12, 101, __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":102
 *         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(12, 102, __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(12, 102, __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(12, 102, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_7) {

      /* "pyarrow/table.pxi":103
 *         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(12, 103, __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(12, 103, __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(12, 103, __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(12, 103, __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":102
 *         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":105
 *                 return self.chunk(j)[index]
 *             else:
 *                 index -= self.chunked_array.chunk(j).get().length()             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
    /*else*/ {
      __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_self->chunked_array->chunk(__pyx_v_j).get()->length()); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 105, __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(12, 105, __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":97
 *             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":107
 *                 index -= self.chunked_array.chunk(j).get().length()
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         try:
 *             return self.equals(other)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_22__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_22__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_21__eq__(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self), ((PyObject *)__pyx_v_other));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_21__eq__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "pyarrow/table.pxi":108
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "pyarrow/table.pxi":109
 *     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(12, 109, __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(12, 109, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "pyarrow/table.pxi":108
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/table.pxi":110
 *         try:
 *             return self.equals(other)
 *         except TypeError:             # <<<<<<<<<<<<<<
 *             return NotImplemented
 * 
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(12, 110, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "pyarrow/table.pxi":111
 *             return self.equals(other)
 *         except TypeError:
 *             return NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     def equals(self, ChunkedArray other):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_builtin_NotImplemented);
      __pyx_r = __pyx_builtin_NotImplemented;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/table.pxi":108
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "pyarrow/table.pxi":107
 *                 index -= self.chunked_array.chunk(j).get().length()
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         try:
 *             return self.equals(other)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":113
 *             return NotImplemented
 * 
 *     def equals(self, ChunkedArray other):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the contents of two chunked arrays are equal
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_24equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_23equals[] = "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_24equals(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(12, 113, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_23equals(((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_23equals(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_other) {
   arrow::ChunkedArray *__pyx_v_this_arr;
   arrow::ChunkedArray *__pyx_v_other_arr;
  bool __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
   arrow::ChunkedArray *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/table.pxi":126
 *         """
 *         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":127
 *         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":130
 *             c_bool result
 * 
 *         if other is None:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_other) == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/table.pxi":131
 * 
 *         if other is None:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":130
 *             c_bool result
 * 
 *         if other is None:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  }

  /* "pyarrow/table.pxi":133
 *             return False
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = this_arr.Equals(deref(other_arr))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":134
 * 
 *         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":133
 *             return False
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = this_arr.Equals(deref(other_arr))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L6;
        }
        __pyx_L6:;
      }
  }

  /* "pyarrow/table.pxi":136
 *             result = this_arr.Equals(deref(other_arr))
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def _to_pandas(self, options, **kwargs):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":113
 *             return NotImplemented
 * 
 *     def equals(self, ChunkedArray other):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the contents of two chunked arrays are equal
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":138
 *         return result
 * 
 *     def _to_pandas(self, options, **kwargs):             # <<<<<<<<<<<<<<
 *         cdef:
 *             PyObject* out
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_26_to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_25_to_pandas[] = "ChunkedArray._to_pandas(self, options, **kwargs)";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_26_to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_options = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_to_pandas (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_options,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "_to_pandas") < 0)) __PYX_ERR(12, 138, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_options = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_to_pandas", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 138, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray._to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_25_to_pandas(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self), __pyx_v_options, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_25_to_pandas(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_options, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_v_out;
  struct arrow::py::PandasOptions __pyx_v_c_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":141
 *         cdef:
 *             PyObject* out
 *             PandasOptions c_options = options             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_1 = __pyx_convert__from_py_struct__arrow_3a__3a_py_3a__3a_PandasOptions(__pyx_v_options); if (unlikely(PyErr_Occurred())) __PYX_ERR(12, 141, __pyx_L1_error)
  __pyx_v_c_options = __pyx_t_1;

  /* "pyarrow/table.pxi":143
 *             PandasOptions c_options = options
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(libarrow.ConvertChunkedArrayToPandas(
 *                 c_options,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":144
 * 
 *         with nogil:
 *             check_status(libarrow.ConvertChunkedArrayToPandas(             # <<<<<<<<<<<<<<
 *                 c_options,
 *                 self.sp_chunked_array,
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::ConvertChunkedArrayToPandas(__pyx_v_c_options, __pyx_v_self->sp_chunked_array, ((PyObject *)__pyx_v_self), (&__pyx_v_out))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(12, 144, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":143
 *             PandasOptions c_options = options
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(libarrow.ConvertChunkedArrayToPandas(
 *                 c_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":149
 *                 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(12, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":138
 *         return result
 * 
 *     def _to_pandas(self, options, **kwargs):             # <<<<<<<<<<<<<<
 *         cdef:
 *             PyObject* out
 */

  /* 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":151
 *         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_28__array__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_27__array__[] = "ChunkedArray.__array__(self, dtype=None)";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_28__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(12, 151, __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(12, 151, __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_27__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_27__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":152
 * 
 *     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":153
 *     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_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 153, __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(12, 153, __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":152
 * 
 *     def __array__(self, dtype=None):
 *         if dtype is None:             # <<<<<<<<<<<<<<
 *             return self.to_pandas()
 *         return self.to_pandas().astype(dtype)
 */
  }

  /* "pyarrow/table.pxi":154
 *         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_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 154, __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(12, 154, __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(12, 154, __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(12, 154, __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":151
 *         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":156
 *         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_30dictionary_encode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_29dictionary_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_30dictionary_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_29dictionary_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_29dictionary_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":167
 *         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":168
 * 
 *         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(12, 168, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":167
 *         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":172
 *                                  &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(12, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":156
 *         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":174
 *         return wrap_datum(out)
 * 
 *     def unique(self):             # <<<<<<<<<<<<<<
 *         """
 *         Compute distinct elements in array
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_32unique(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_31unique[] = "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_32unique(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_31unique(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_31unique(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":184
 *         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":185
 * 
 *         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(12, 185, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":184
 *         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":188
 *                 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(12, 188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":174
 *         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":190
 *         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_34slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_33slice[] = "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_34slice(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(12, 190, __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(12, 190, __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_33slice(((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_33slice(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":208
 *         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(12, 208, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(12, 208, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/table.pxi":209
 * 
 *         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__116, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 209, __pyx_L1_error)
    __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, 209, __pyx_L1_error)

    /* "pyarrow/table.pxi":208
 *         cdef shared_ptr[CChunkedArray] result
 * 
 *         if offset < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError('Offset must be non-negative')
 * 
 */
  }

  /* "pyarrow/table.pxi":211
 *             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":212
 * 
 *         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(12, 212, __pyx_L1_error)
    __pyx_v_result = __pyx_v_self->chunked_array->Slice(__pyx_t_4);

    /* "pyarrow/table.pxi":211
 *             raise IndexError('Offset must be non-negative')
 * 
 *         if length is None:             # <<<<<<<<<<<<<<
 *             result = self.chunked_array.Slice(offset)
 *         else:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/table.pxi":214
 *             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(12, 214, __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(12, 214, __pyx_L1_error)
    __pyx_v_result = __pyx_v_self->chunked_array->Slice(__pyx_t_4, __pyx_t_5);
  }
  __pyx_L4:;

  /* "pyarrow/table.pxi":216
 *             result = self.chunked_array.Slice(offset, length)
 * 
 *         return pyarrow_wrap_chunked_array(result)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":190
 *         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":219
 * 
 *     @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":227
 *         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(12, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":219
 * 
 *     @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":229
 *         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_36chunk(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_35chunk[] = "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_36chunk(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_35chunk(((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_35chunk(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":241
 *         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(12, 241, __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(12, 241, __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(12, 241, __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(12, 241, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(12, 241, __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":242
 *         """
 *         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__132, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 242, __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(12, 242, __pyx_L1_error)

    /* "pyarrow/table.pxi":241
 *         pyarrow.Array
 *         """
 *         if i >= self.num_chunks or i < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError('Chunk index out of range.')
 * 
 */
  }

  /* "pyarrow/table.pxi":244
 *             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(12, 244, __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(12, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":229
 *         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":247
 * 
 *     @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":248
 *     @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(12, 248, __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, 248, __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(12, 248, __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":247
 * 
 *     @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_39generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/table.pxi":250
 *         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_38iterchunks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_37iterchunks[] = "ChunkedArray.iterchunks(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_38iterchunks(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_37iterchunks(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_37iterchunks(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7_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_7_iterchunks *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_7_iterchunks(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_7_iterchunks, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7_iterchunks *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(12, 250, __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_39generator6, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iterchunks, __pyx_n_s_ChunkedArray_iterchunks, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(12, 250, __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_39generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7_iterchunks *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7_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(12, 250, __pyx_L1_error)

  /* "pyarrow/table.pxi":251
 * 
 *     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(12, 251, __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(12, 251, __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(12, 251, __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(12, 251, __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(12, 251, __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(12, 251, __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(12, 251, __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(12, 251, __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(12, 251, __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":252
 *     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(12, 252, __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(12, 252, __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(12, 252, __pyx_L1_error)

    /* "pyarrow/table.pxi":251
 * 
 *     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":250
 *         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":254
 *             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_41to_pylist(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_40to_pylist[] = "ChunkedArray.to_pylist(self)\n\n        Convert to a list of native Python objects.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_41to_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_40to_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_40to_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":258
 *         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(12, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":259
 *         """
 *         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(12, 259, __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(12, 259, __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(12, 259, __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(12, 259, __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(12, 259, __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(12, 259, __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(12, 259, __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(12, 259, __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(12, 259, __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":260
 *         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(12, 260, __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(12, 260, __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(12, 260, __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(12, 260, __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(12, 260, __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":259
 *         """
 *         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":261
 *         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":254
 *             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":264
 * 
 * 
 * def chunked_array(arrays, type=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct chunked array from list of array-like objects
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_99chunked_array(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_98chunked_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_99chunked_array = {"chunked_array", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_99chunked_array, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_98chunked_array};
static PyObject *__pyx_pw_7pyarrow_3lib_99chunked_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(12, 264, __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(12, 264, __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_98chunked_array(__pyx_self, __pyx_v_arrays, __pyx_v_type);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_98chunked_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":283
 *         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(12, 283, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 283, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(12, 283, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 283, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(12, 283, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 283, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(12, 283, __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":284
 * 
 *     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":285
 *     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(12, 285, __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":286
 *         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":287
 *             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(12, 287, __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(12, 287, __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(12, 287, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_5)) {
            PyErr_SetNone(PyExc_AssertionError);
            __PYX_ERR(12, 287, __pyx_L1_error)
          }
        }
        #endif

        /* "pyarrow/table.pxi":286
 *         if isinstance(x, Array):
 *             arr = x
 *             if type is not None:             # <<<<<<<<<<<<<<
 *                 assert x.type == type
 *         else:
 */
      }

      /* "pyarrow/table.pxi":284
 * 
 *     for x in arrays:
 *         if isinstance(x, Array):             # <<<<<<<<<<<<<<
 *             arr = x
 *             if type is not None:
 */
      goto __pyx_L5;
    }

    /* "pyarrow/table.pxi":289
 *                 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(12, 289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 289, __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(12, 289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_type, __pyx_v_type) < 0) __PYX_ERR(12, 289, __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(12, 289, __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(12, 289, __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":291
 *             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(12, 291, __pyx_L1_error)
    }

    /* "pyarrow/table.pxi":283
 *         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":293
 *         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(12, 293, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "pyarrow/table.pxi":294
 * 
 *     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":295
 *     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":293
 *         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":297
 *         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":298
 *     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__133, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 298, __pyx_L1_error)
      __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, 298, __pyx_L1_error)

      /* "pyarrow/table.pxi":297
 *         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":300
 *             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":301
 *                              "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 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array(__pyx_v_sp_chunked_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":264
 * 
 * 
 * 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":304
 * 
 * 
 * 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_101column(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_100column[] = "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_101column = {"column", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_101column, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_100column};
static PyObject *__pyx_pw_7pyarrow_3lib_101column(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(12, 304, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "column") < 0)) __PYX_ERR(12, 304, __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(12, 304, __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_100column(__pyx_self, __pyx_v_field_or_name, __pyx_v_arr);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_100column(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":323
 *         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":324
 * 
 *     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(12, 324, __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(12, 324, __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":323
 *         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":325
 *     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":326
 *         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(12, 326, __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(12, 326, __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":325
 *     if isinstance(arr, list):
 *         arr = chunked_array(arr)
 *     elif not isinstance(arr, (Array, ChunkedArray)):             # <<<<<<<<<<<<<<
 *         arr = array(arr)
 * 
 */
  }
  __pyx_L3:;

  /* "pyarrow/table.pxi":328
 *         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":329
 * 
 *     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(12, 329, __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":330
 *     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(12, 330, __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(12, 330, __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(12, 330, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(__pyx_t_2)) {

      /* "pyarrow/table.pxi":331
 *         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__134, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 331, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(12, 331, __pyx_L1_error)

      /* "pyarrow/table.pxi":330
 *     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":328
 *         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":333
 *             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(12, 333, __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(12, 333, __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(12, 333, __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(12, 333, __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(12, 333, __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(12, 333, __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(12, 333, __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":335
 *         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":336
 * 
 *     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(12, 336, __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":337
 *     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":335
 *         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":338
 *         _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":339
 *         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(12, 339, __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":340
 *     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":338
 *         _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":343
 *                                     _carr.sp_chunked_array))
 *     else:
 *         raise ValueError("Unsupported type for column(...): {}"             # <<<<<<<<<<<<<<
 *                          .format(type(arr)))
 * 
 */
  /*else*/ {

    /* "pyarrow/table.pxi":344
 *     else:
 *         raise ValueError("Unsupported type for column(...): {}"
 *                          .format(type(arr)))             # <<<<<<<<<<<<<<
 * 
 *     return pyarrow_wrap_column(sp_column)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unsupported_type_for_column, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 344, __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(12, 344, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pyarrow/table.pxi":343
 *                                     _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(12, 343, __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(12, 343, __pyx_L1_error)
  }
  __pyx_L8:;

  /* "pyarrow/table.pxi":346
 *                          .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(12, 346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":304
 * 
 * 
 * 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":358
 *     """
 * 
 *     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":359
 * 
 *     def __cinit__(self):
 *         self.column = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self):
 */
  __pyx_v_self->column = NULL;

  /* "pyarrow/table.pxi":358
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.column = NULL
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":361
 *         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":362
 * 
 *     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__135, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(12, 362, __pyx_L1_error)

  /* "pyarrow/table.pxi":361
 *         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":365
 *                         "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":366
 * 
 *     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":367
 *     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":365
 *                         "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":369
 *         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":370
 * 
 *     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(12, 370, __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(12, 370, __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(12, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 370, __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(12, 370, __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":369
 *         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":372
 *         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":373
 * 
 *     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(12, 373, __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, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 373, __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(12, 373, __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":374
 *     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(12, 374, __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":375
 *         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(12, 375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/table.pxi":376
 *         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_u_Column_name_0_r_type_1_r, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 376, __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(12, 376, __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(12, 376, __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(12, 376, __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(12, 376, __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(12, 376, __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(12, 376, __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(12, 375, __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":377
 *         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(12, 377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u__136, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 377, __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(12, 377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 377, __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(12, 377, __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(12, 377, __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":379
 *         result.write('\n{}'.format(str(self.data)))
 * 
 *         return result.getvalue()             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, key):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_getvalue); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 379, __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(12, 379, __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":372
 *         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":381
 *         return result.getvalue()
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         return self.data[key]
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_9__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_9__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Column_8__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_8__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":382
 * 
 *     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(12, 382, __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(12, 382, __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":381
 *         return result.getvalue()
 * 
 *     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":385
 * 
 *     @staticmethod
 *     def from_array(*args):             # <<<<<<<<<<<<<<
 *         return column(*args)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_11from_array(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Column_10from_array[] = "Column.from_array(*args)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_6Column_11from_array = {"from_array", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Column_11from_array, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Column_10from_array};
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_11from_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_10from_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_10from_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":386
 *     @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(12, 386, __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(12, 386, __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":385
 * 
 *     @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":388
 *         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_13cast(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Column_12cast[] = "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_13cast(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(12, 388, __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(12, 388, __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(12, 388, __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_12cast(((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_12cast(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":404
 *         """
 *         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":405
 *         cdef:
 *             CCastOptions options = CCastOptions(safe)
 *             DataType type = ensure_type(target_type)             # <<<<<<<<<<<<<<
 *             shared_ptr[CArray] result
 *             CDatum out
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_ensure_type(__pyx_v_target_type, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 405, __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":409
 *             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":410
 * 
 *         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(12, 410, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":409
 *             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":413
 *                               type.sp_type, options, &out))
 * 
 *         casted_data = pyarrow_wrap_chunked_array(out.chunked_array())             # <<<<<<<<<<<<<<
 *         return column(self.name, casted_data)
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array(__pyx_v_out.chunked_array()); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_casted_data = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":414
 * 
 *         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(12, 414, __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(12, 414, __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(12, 414, __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(12, 414, __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(12, 414, __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(12, 414, __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":388
 *         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":416
 *         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_15dictionary_encode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Column_14dictionary_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_15dictionary_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_14dictionary_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_14dictionary_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":425
 *             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(12, 425, __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(12, 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(12, 425, __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":426
 *         """
 *         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(12, 426, __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(12, 426, __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(12, 426, __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(12, 426, __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(12, 426, __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(12, 426, __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":416
 *         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":428
 *         return column(self.name, ca)
 * 
 *     def unique(self):             # <<<<<<<<<<<<<<
 *         """
 *         Compute distinct elements in array
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_17unique(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Column_16unique[] = "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_17unique(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_16unique(((struct __pyx_obj_7pyarrow_3lib_Column *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Column_16unique(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":436
 *         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(12, 436, __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(12, 436, __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(12, 436, __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":428
 *         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":438
 *         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_19flatten(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Column_18flatten[] = "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_19flatten(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(12, 438, __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(12, 438, __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(12, 438, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Column_18flatten(((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_18flatten(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_8genexpr9__pyx_v_col;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  std::vector<std::shared_ptr< arrow::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":454
 *         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":456
 *             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":457
 * 
 *         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(12, 457, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":456
 *             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":459
 *             check_status(self.column.Flatten(pool, &flattened))
 * 
 *         return [pyarrow_wrap_column(col) for col in flattened]             # <<<<<<<<<<<<<<
 * 
 *     def _to_pandas(self, options, **kwargs):
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 459, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_v_flattened.begin();
    for (;;) {
      if (!(__pyx_t_3 != __pyx_v_flattened.end())) break;
      __pyx_t_4 = *__pyx_t_3;
      ++__pyx_t_3;
      __pyx_8genexpr9__pyx_v_col = __pyx_t_4;
      __pyx_t_5 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_column(__pyx_8genexpr9__pyx_v_col); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 459, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) __PYX_ERR(12, 459, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  } /* exit inner scope */
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":438
 *         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":461
 *         return [pyarrow_wrap_column(col) for col in flattened]
 * 
 *     def _to_pandas(self, options, **kwargs):             # <<<<<<<<<<<<<<
 *         values = self.data._to_pandas(options)
 *         result = pandas_api.make_series(values, name=self.name)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_21_to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Column_20_to_pandas[] = "Column._to_pandas(self, options, **kwargs)";
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_21_to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_options = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_to_pandas (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_options,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "_to_pandas") < 0)) __PYX_ERR(12, 461, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_options = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_to_pandas", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 461, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __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_20_to_pandas(((struct __pyx_obj_7pyarrow_3lib_Column *)__pyx_v_self), __pyx_v_options, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Column_20_to_pandas(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self, PyObject *__pyx_v_options, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  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":462
 * 
 *     def _to_pandas(self, options, **kwargs):
 *         values = self.data._to_pandas(options)             # <<<<<<<<<<<<<<
 *         result = pandas_api.make_series(values, name=self.name)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_to_pandas); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_options) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_options);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_values = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":463
 *     def _to_pandas(self, options, **kwargs):
 *         values = self.data._to_pandas(options)
 *         result = pandas_api.make_series(values, name=self.name)             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(self.type, TimestampType):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_7pyarrow_3lib_pandas_api), __pyx_n_s_make_series); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 463, __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(12, 463, __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(12, 463, __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(12, 463, __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(12, 463, __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":465
 *         result = pandas_api.make_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(12, 465, __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":466
 * 
 *         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(12, 466, __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(12, 466, __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":467
 *         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":468
 *             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(12, 468, __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(12, 468, __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":469
 *             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(12, 469, __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(12, 469, __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_u_utc) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_n_u_utc);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 469, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "pyarrow/table.pxi":470
 *                 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(12, 470, __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(12, 470, __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(12, 470, __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":467
 *         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":465
 *         result = pandas_api.make_series(values, name=self.name)
 * 
 *         if isinstance(self.type, TimestampType):             # <<<<<<<<<<<<<<
 *             tz = self.type.tz
 *             if tz is not None:
 */
  }

  /* "pyarrow/table.pxi":472
 *                           .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":461
 *         return [pyarrow_wrap_column(col) for col in flattened]
 * 
 *     def _to_pandas(self, options, **kwargs):             # <<<<<<<<<<<<<<
 *         values = self.data._to_pandas(options)
 *         result = pandas_api.make_series(values, name=self.name)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.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":474
 *         return result
 * 
 *     def __array__(self, dtype=None):             # <<<<<<<<<<<<<<
 *         return self.data.__array__(dtype=dtype)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_23__array__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Column_22__array__[] = "Column.__array__(self, dtype=None)";
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_23__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(12, 474, __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(12, 474, __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_22__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_22__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":475
 * 
 *     def __array__(self, dtype=None):
 *         return self.data.__array__(dtype=dtype)             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, 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(12, 475, __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(12, 475, __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(12, 475, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_v_dtype) < 0) __PYX_ERR(12, 475, __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(12, 475, __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":474
 *         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":477
 *         return self.data.__array__(dtype=dtype)
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         try:
 *             return self.equals(other)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_25__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_25__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Column_24__eq__(((struct __pyx_obj_7pyarrow_3lib_Column *)__pyx_v_self), ((PyObject *)__pyx_v_other));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Column_24__eq__(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "pyarrow/table.pxi":478
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "pyarrow/table.pxi":479
 *     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(12, 479, __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(12, 479, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "pyarrow/table.pxi":478
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/table.pxi":480
 *         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.Column.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(12, 480, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "pyarrow/table.pxi":481
 *             return self.equals(other)
 *         except TypeError:
 *             return NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     def equals(self, Column other):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_builtin_NotImplemented);
      __pyx_r = __pyx_builtin_NotImplemented;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/table.pxi":478
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "pyarrow/table.pxi":477
 *         return self.data.__array__(dtype=dtype)
 * 
 *     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.Column.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":483
 *             return NotImplemented
 * 
 *     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(12, 483, __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;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/table.pxi":496
 *         """
 *         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":497
 *         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":500
 *             c_bool result
 * 
 *         if other is None:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_other) == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/table.pxi":501
 * 
 *         if other is None:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":500
 *             c_bool result
 * 
 *         if other is None:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  }

  /* "pyarrow/table.pxi":503
 *             return False
 * 
 *         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":504
 * 
 *         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":503
 *             return False
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = this_col.Equals(deref(other_col))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L6;
        }
        __pyx_L6:;
      }
  }

  /* "pyarrow/table.pxi":506
 *             result = this_col.Equals(deref(other_col))
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def to_pylist(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":483
 *             return NotImplemented
 * 
 *     def equals(self, Column other):             # <<<<<<<<<<<<<<
 *         """
 *         Check if contents of two columns are equal
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __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":508
 *         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":512
 *         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(12, 512, __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(12, 512, __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(12, 512, __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":508
 *         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":514
 *         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":515
 * 
 *     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(12, 515, __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, 515, __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(12, 515, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":514
 *         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":517
 *         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":518
 * 
 *     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(12, 518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":517
 *         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":521
 * 
 *     @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":522
 *     @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(12, 522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":521
 * 
 *     @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":525
 * 
 *     @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":533
 *         (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(12, 533, __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, 533, __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(12, 533, __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":525
 * 
 *     @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":536
 * 
 *     @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":544
 *         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(12, 544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":536
 * 
 *     @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":547
 * 
 *     @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":555
 *         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(12, 555, __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(12, 555, __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(12, 555, __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":547
 * 
 *     @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":558
 * 
 *     @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":566
 *         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(12, 566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":558
 * 
 *     @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":569
 * 
 *     @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":577
 *         pyarrow.ChunkedArray
 *         """
 *         return pyarrow_wrap_chunked_array(self.column.data())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array(__pyx_v_self->column->data()); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":569
 * 
 *     @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":580
 * 
 * 
 * cdef _schema_from_arrays(arrays, names, metadata, shared_ptr[CSchema]* schema):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t K = len(arrays)
 */

static PyObject *__pyx_f_7pyarrow_3lib__schema_from_arrays(PyObject *__pyx_v_arrays, PyObject *__pyx_v_names, PyObject *__pyx_v_metadata, std::shared_ptr< arrow::Schema>  *__pyx_v_schema) {
  Py_ssize_t __pyx_v_K;
  std::string __pyx_v_c_name;
   arrow::Column *__pyx_v_c_column;
  std::shared_ptr< arrow::DataType>  __pyx_v_c_type;
  std::shared_ptr< arrow::KeyValueMetadata>  __pyx_v_c_meta;
  std::vector<std::shared_ptr< arrow::Field> >  __pyx_v_c_fields;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
   arrow::Column *__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;
  int __pyx_t_14;
  std::shared_ptr< arrow::DataType>  __pyx_t_15;
  std::string __pyx_t_16;
  __Pyx_RefNannySetupContext("_schema_from_arrays", 0);

  /* "pyarrow/table.pxi":582
 * cdef _schema_from_arrays(arrays, names, metadata, shared_ptr[CSchema]* schema):
 *     cdef:
 *         Py_ssize_t K = len(arrays)             # <<<<<<<<<<<<<<
 *         c_string c_name
 *         CColumn* c_column
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_arrays); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(12, 582, __pyx_L1_error)
  __pyx_v_K = __pyx_t_1;

  /* "pyarrow/table.pxi":589
 *         vector[shared_ptr[CField]] c_fields
 * 
 *     if metadata is not None:             # <<<<<<<<<<<<<<
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')
 */
  __pyx_t_2 = (__pyx_v_metadata != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/table.pxi":590
 * 
 *     if metadata is not None:
 *         if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *             raise TypeError('Metadata must be an instance of dict')
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 */
    __pyx_t_3 = PyDict_Check(__pyx_v_metadata); 
    __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0);
    if (unlikely(__pyx_t_2)) {

      /* "pyarrow/table.pxi":591
 *     if metadata is not None:
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')             # <<<<<<<<<<<<<<
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 591, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(12, 591, __pyx_L1_error)

      /* "pyarrow/table.pxi":590
 * 
 *     if metadata is not None:
 *         if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *             raise TypeError('Metadata must be an instance of dict')
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 */
    }

    /* "pyarrow/table.pxi":592
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')
 *         c_meta = pyarrow_unwrap_metadata(metadata)             # <<<<<<<<<<<<<<
 * 
 *     if K == 0:
 */
    __pyx_v_c_meta = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_metadata(__pyx_v_metadata);

    /* "pyarrow/table.pxi":589
 *         vector[shared_ptr[CField]] c_fields
 * 
 *     if metadata is not None:             # <<<<<<<<<<<<<<
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')
 */
  }

  /* "pyarrow/table.pxi":594
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 *     if K == 0:             # <<<<<<<<<<<<<<
 *         schema.reset(new CSchema(c_fields, c_meta))
 *         return
 */
  __pyx_t_2 = ((__pyx_v_K == 0) != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":595
 * 
 *     if K == 0:
 *         schema.reset(new CSchema(c_fields, c_meta))             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_v_schema->reset(new  arrow::Schema(__pyx_v_c_fields, __pyx_v_c_meta));

    /* "pyarrow/table.pxi":596
 *     if K == 0:
 *         schema.reset(new CSchema(c_fields, c_meta))
 *         return             # <<<<<<<<<<<<<<
 * 
 *     c_fields.resize(K)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/table.pxi":594
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 *     if K == 0:             # <<<<<<<<<<<<<<
 *         schema.reset(new CSchema(c_fields, c_meta))
 *         return
 */
  }

  /* "pyarrow/table.pxi":598
 *         return
 * 
 *     c_fields.resize(K)             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(arrays[0], Column):
 */
  try {
    __pyx_v_c_fields.resize(__pyx_v_K);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(12, 598, __pyx_L1_error)
  }

  /* "pyarrow/table.pxi":600
 *     c_fields.resize(K)
 * 
 *     if isinstance(arrays[0], Column):             # <<<<<<<<<<<<<<
 *         for i in range(K):
 *             c_column = (<Column>arrays[i]).column
 */
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_arrays, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_Column); 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/table.pxi":601
 * 
 *     if isinstance(arrays[0], Column):
 *         for i in range(K):             # <<<<<<<<<<<<<<
 *             c_column = (<Column>arrays[i]).column
 *             c_fields[i] = c_column.field()
 */
    __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":602
 *     if isinstance(arrays[0], Column):
 *         for i in range(K):
 *             c_column = (<Column>arrays[i]).column             # <<<<<<<<<<<<<<
 *             c_fields[i] = c_column.field()
 *     else:
 */
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_arrays, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 602, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = ((struct __pyx_obj_7pyarrow_3lib_Column *)__pyx_t_4)->column;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_c_column = __pyx_t_7;

      /* "pyarrow/table.pxi":603
 *         for i in range(K):
 *             c_column = (<Column>arrays[i]).column
 *             c_fields[i] = c_column.field()             # <<<<<<<<<<<<<<
 *     else:
 *         if names is None:
 */
      (__pyx_v_c_fields[__pyx_v_i]) = __pyx_v_c_column->field();
    }

    /* "pyarrow/table.pxi":600
 *     c_fields.resize(K)
 * 
 *     if isinstance(arrays[0], Column):             # <<<<<<<<<<<<<<
 *         for i in range(K):
 *             c_column = (<Column>arrays[i]).column
 */
    goto __pyx_L6;
  }

  /* "pyarrow/table.pxi":605
 *             c_fields[i] = c_column.field()
 *     else:
 *         if names is None:             # <<<<<<<<<<<<<<
 *             raise ValueError('Must pass names when constructing '
 *                              'from Array objects')
 */
  /*else*/ {
    __pyx_t_3 = (__pyx_v_names == Py_None);
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (unlikely(__pyx_t_2)) {

      /* "pyarrow/table.pxi":606
 *     else:
 *         if names is None:
 *             raise ValueError('Must pass names when constructing '             # <<<<<<<<<<<<<<
 *                              'from Array objects')
 *         if len(names) != K:
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__137, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(12, 606, __pyx_L1_error)

      /* "pyarrow/table.pxi":605
 *             c_fields[i] = c_column.field()
 *     else:
 *         if names is None:             # <<<<<<<<<<<<<<
 *             raise ValueError('Must pass names when constructing '
 *                              'from Array objects')
 */
    }

    /* "pyarrow/table.pxi":608
 *             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(12, 608, __pyx_L1_error)
    __pyx_t_2 = ((__pyx_t_1 != __pyx_v_K) != 0);
    if (unlikely(__pyx_t_2)) {

      /* "pyarrow/table.pxi":610
 *         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_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Length_of_names_does_not_match_l, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 610, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_1 = PyObject_Length(__pyx_v_names); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(12, 610, __pyx_L1_error)
      __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(12, 610, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = PyInt_FromSsize_t(__pyx_v_K); if (unlikely(!__pyx_t_10)) __PYX_ERR(12, 610, __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_4 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 610, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __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_4 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 610, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __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(12, 610, __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_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 610, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "pyarrow/table.pxi":609
 *                              '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_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 609, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(12, 609, __pyx_L1_error)

      /* "pyarrow/table.pxi":608
 *             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":611
 *             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":612
 *                              'length of arrays ({})'.format(len(names), K))
 *         for i in range(K):
 *             val = arrays[i]             # <<<<<<<<<<<<<<
 *             if isinstance(val, (Array, ChunkedArray)):
 *                 c_type = (<DataType> val.type).sp_type
 */
      __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_arrays, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 612, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "pyarrow/table.pxi":613
 *         for i in range(K):
 *             val = arrays[i]
 *             if isinstance(val, (Array, ChunkedArray)):             # <<<<<<<<<<<<<<
 *                 c_type = (<DataType> val.type).sp_type
 *             else:
 */
      __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_val, __pyx_ptype_7pyarrow_3lib_Array); 
      __pyx_t_14 = (__pyx_t_3 != 0);
      if (!__pyx_t_14) {
      } else {
        __pyx_t_2 = __pyx_t_14;
        goto __pyx_L14_bool_binop_done;
      }
      __pyx_t_14 = __Pyx_TypeCheck(__pyx_v_val, __pyx_ptype_7pyarrow_3lib_ChunkedArray); 
      __pyx_t_3 = (__pyx_t_14 != 0);
      __pyx_t_2 = __pyx_t_3;
      __pyx_L14_bool_binop_done:;
      __pyx_t_3 = (__pyx_t_2 != 0);
      if (likely(__pyx_t_3)) {

        /* "pyarrow/table.pxi":614
 *             val = arrays[i]
 *             if isinstance(val, (Array, ChunkedArray)):
 *                 c_type = (<DataType> val.type).sp_type             # <<<<<<<<<<<<<<
 *             else:
 *                 raise TypeError(type(val))
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_type); if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 614, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_15 = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_8)->sp_type;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_v_c_type = __pyx_t_15;

        /* "pyarrow/table.pxi":613
 *         for i in range(K):
 *             val = arrays[i]
 *             if isinstance(val, (Array, ChunkedArray)):             # <<<<<<<<<<<<<<
 *                 c_type = (<DataType> val.type).sp_type
 *             else:
 */
        goto __pyx_L13;
      }

      /* "pyarrow/table.pxi":616
 *                 c_type = (<DataType> val.type).sp_type
 *             else:
 *                 raise TypeError(type(val))             # <<<<<<<<<<<<<<
 * 
 *             if names[i] is None:
 */
      /*else*/ {
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, ((PyObject *)Py_TYPE(__pyx_v_val))); if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 616, __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(12, 616, __pyx_L1_error)
      }
      __pyx_L13:;

      /* "pyarrow/table.pxi":618
 *                 raise TypeError(type(val))
 * 
 *             if names[i] is None:             # <<<<<<<<<<<<<<
 *                 c_name = tobytes(u'None')
 *             else:
 */
      __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_names, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 618, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_3 = (__pyx_t_8 == Py_None);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_2 = (__pyx_t_3 != 0);
      if (__pyx_t_2) {

        /* "pyarrow/table.pxi":619
 * 
 *             if names[i] is None:
 *                 c_name = tobytes(u'None')             # <<<<<<<<<<<<<<
 *             else:
 *                 c_name = tobytes(names[i])
 */
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 619, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_13 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_8 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_13, __pyx_n_u_None) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_u_None);
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 619, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_16 = __pyx_convert_string_from_py_std__in_string(__pyx_t_8); if (unlikely(PyErr_Occurred())) __PYX_ERR(12, 619, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_v_c_name = __pyx_t_16;

        /* "pyarrow/table.pxi":618
 *                 raise TypeError(type(val))
 * 
 *             if names[i] is None:             # <<<<<<<<<<<<<<
 *                 c_name = tobytes(u'None')
 *             else:
 */
        goto __pyx_L16;
      }

      /* "pyarrow/table.pxi":621
 *                 c_name = tobytes(u'None')
 *             else:
 *                 c_name = tobytes(names[i])             # <<<<<<<<<<<<<<
 *             c_fields[i].reset(new CField(c_name, c_type, True))
 * 
 */
      /*else*/ {
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 621, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __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(12, 621, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_10 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_8 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_10, __pyx_t_13) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_13);
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 621, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_16 = __pyx_convert_string_from_py_std__in_string(__pyx_t_8); if (unlikely(PyErr_Occurred())) __PYX_ERR(12, 621, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_v_c_name = __pyx_t_16;
      }
      __pyx_L16:;

      /* "pyarrow/table.pxi":622
 *             else:
 *                 c_name = tobytes(names[i])
 *             c_fields[i].reset(new CField(c_name, c_type, True))             # <<<<<<<<<<<<<<
 * 
 *     schema.reset(new CSchema(c_fields, c_meta))
 */
      (__pyx_v_c_fields[__pyx_v_i]).reset(new  arrow::Field(__pyx_v_c_name, __pyx_v_c_type, 1));
    }
  }
  __pyx_L6:;

  /* "pyarrow/table.pxi":624
 *             c_fields[i].reset(new CField(c_name, c_type, True))
 * 
 *     schema.reset(new CSchema(c_fields, c_meta))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_schema->reset(new  arrow::Schema(__pyx_v_c_fields, __pyx_v_c_meta));

  /* "pyarrow/table.pxi":580
 * 
 * 
 * cdef _schema_from_arrays(arrays, names, metadata, shared_ptr[CSchema]* schema):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t K = len(arrays)
 */

  /* 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_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._schema_from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":637
 *     """
 * 
 *     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":638
 * 
 *     def __cinit__(self):
 *         self.batch = NULL             # <<<<<<<<<<<<<<
 *         self._schema = None
 * 
 */
  __pyx_v_self->batch = NULL;

  /* "pyarrow/table.pxi":639
 *     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":637
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.batch = NULL
 *         self._schema = None
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":641
 *         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":642
 * 
 *     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__138, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 642, __pyx_L1_error)
  __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, 642, __pyx_L1_error)

  /* "pyarrow/table.pxi":641
 *         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":645
 *                         "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":646
 * 
 *     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":647
 *     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":645
 *                         "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":649
 *         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":650
 * 
 *     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(12, 650, __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(12, 650, __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(12, 650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 650, __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(12, 650, __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":649
 *         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":652
 *         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":653
 * 
 *     def __len__(self):
 *         return self.batch.num_rows()             # <<<<<<<<<<<<<<
 * 
 *     def replace_schema_metadata(self, metadata=None):
 */
  __pyx_r = __pyx_v_self->batch->num_rows();
  goto __pyx_L0;

  /* "pyarrow/table.pxi":652
 *         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":655
 *         return self.batch.num_rows()
 * 
 *     def replace_schema_metadata(self, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         EXPERIMENTAL: Create shallow copy of record batch by replacing schema
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_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, 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(12, 655, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_metadata = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("replace_schema_metadata", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 655, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.replace_schema_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_8replace_schema_metadata(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self), __pyx_v_metadata);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_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_c_batch;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("replace_schema_metadata", 0);

  /* "pyarrow/table.pxi":673
 *             shared_ptr[CRecordBatch] c_batch
 * 
 *         if metadata is not None:             # <<<<<<<<<<<<<<
 *             if not isinstance(metadata, dict):
 *                 raise TypeError('Metadata must be an instance of dict')
 */
  __pyx_t_1 = (__pyx_v_metadata != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":674
 * 
 *         if metadata is not None:
 *             if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *                 raise TypeError('Metadata must be an instance of dict')
 *             c_meta = pyarrow_unwrap_metadata(metadata)
 */
    __pyx_t_2 = PyDict_Check(__pyx_v_metadata); 
    __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
    if (unlikely(__pyx_t_1)) {

      /* "pyarrow/table.pxi":675
 *         if metadata is not None:
 *             if not isinstance(metadata, dict):
 *                 raise TypeError('Metadata must be an instance of dict')             # <<<<<<<<<<<<<<
 *             c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 675, __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(12, 675, __pyx_L1_error)

      /* "pyarrow/table.pxi":674
 * 
 *         if metadata is not None:
 *             if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *                 raise TypeError('Metadata must be an instance of dict')
 *             c_meta = pyarrow_unwrap_metadata(metadata)
 */
    }

    /* "pyarrow/table.pxi":676
 *             if not isinstance(metadata, dict):
 *                 raise TypeError('Metadata must be an instance of dict')
 *             c_meta = pyarrow_unwrap_metadata(metadata)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
    __pyx_v_c_meta = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_metadata(__pyx_v_metadata);

    /* "pyarrow/table.pxi":673
 *             shared_ptr[CRecordBatch] c_batch
 * 
 *         if metadata is not None:             # <<<<<<<<<<<<<<
 *             if not isinstance(metadata, dict):
 *                 raise TypeError('Metadata must be an instance of dict')
 */
  }

  /* "pyarrow/table.pxi":678
 *             c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_batch = self.batch.ReplaceSchemaMetadata(c_meta)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":679
 * 
 *         with nogil:
 *             c_batch = self.batch.ReplaceSchemaMetadata(c_meta)             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_batch(c_batch)
 */
        __pyx_v_c_batch = __pyx_v_self->batch->ReplaceSchemaMetadata(__pyx_v_c_meta);
      }

      /* "pyarrow/table.pxi":678
 *             c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_batch = self.batch.ReplaceSchemaMetadata(c_meta)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/table.pxi":681
 *             c_batch = self.batch.ReplaceSchemaMetadata(c_meta)
 * 
 *         return pyarrow_wrap_batch(c_batch)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_batch(__pyx_v_c_batch); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":655
 *         return self.batch.num_rows()
 * 
 *     def replace_schema_metadata(self, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         EXPERIMENTAL: Create shallow copy of record batch by replacing schema
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.replace_schema_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":684
 * 
 *     @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":692
 *         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(12, 692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":684
 * 
 *     @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":695
 * 
 *     @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":706
 *         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(12, 706, __pyx_L1_error)
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":695
 * 
 *     @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":709
 * 
 *     @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":717
 *         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":718
 *         """
 *         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(12, 718, __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(12, 718, __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":717
 *         pyarrow.Schema
 *         """
 *         if self._schema is None:             # <<<<<<<<<<<<<<
 *             self._schema = pyarrow_wrap_schema(self.batch.schema())
 * 
 */
  }

  /* "pyarrow/table.pxi":720
 *             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":709
 * 
 *     @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":723
 * 
 *     @property
 *     def columns(self):             # <<<<<<<<<<<<<<
 *         """
 *         List of all columns in numerical order
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_7columns_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_7columns_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_7columns___get__(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_7columns___get__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self) {
  PyObject *__pyx_9genexpr10__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/table.pxi":731
 *         list of pa.Column
 *         """
 *         return [self.column(i) for i in range(self.num_columns)]             # <<<<<<<<<<<<<<
 * 
 *     def column(self, i):
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 731, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_columns); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 731, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 731, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 731, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 731, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(12, 731, __pyx_L5_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 731, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(12, 731, __pyx_L5_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 731, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_5(__pyx_t_2);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(12, 731, __pyx_L5_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr10__pyx_v_i, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_column); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 731, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_9genexpr10__pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_9genexpr10__pyx_v_i);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 731, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(12, 731, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_i); __pyx_9genexpr10__pyx_v_i = 0;
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_i); __pyx_9genexpr10__pyx_v_i = 0;
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":723
 * 
 *     @property
 *     def columns(self):             # <<<<<<<<<<<<<<
 *         """
 *         List of all columns in numerical order
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.columns.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":733
 *         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":741
 *         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(12, 741, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Negative(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 741, __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(12, 741, __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(12, 741, __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(12, 741, __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(12, 741, __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":743
 *         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_u_Record_batch_column_index_d_is_o, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 743, __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(12, 743, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pyarrow/table.pxi":742
 *         """
 *         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(12, 742, __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(12, 742, __pyx_L1_error)

    /* "pyarrow/table.pxi":741
 *         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":745
 *                 '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(12, 745, __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(12, 745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":733
 *         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":747
 *         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":748
 * 
 *     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":749
 *     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(12, 749, __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(12, 749, __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(12, 749, __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(12, 749, __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(12, 749, __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":748
 * 
 *     def __getitem__(self, key):
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return _normalize_slice(self, key)
 *         else:
 */
  }

  /* "pyarrow/table.pxi":751
 *             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(12, 751, __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(12, 751, __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(12, 751, __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(12, 751, __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(12, 751, __pyx_L1_error)
    __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 751, __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(12, 751, __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":747
 *         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":753
 *             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(12, 753, __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(12, 753, __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":768
 *         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(12, 768, __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":770
 *             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":771
 * 
 *         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(12, 771, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":770
 *             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":773
 *             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(12, 773, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":753
 *             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":775
 *         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(12, 775, __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(12, 775, __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":793
 *         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(12, 793, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(12, 793, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/table.pxi":794
 * 
 *         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__116, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 794, __pyx_L1_error)
    __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, 794, __pyx_L1_error)

    /* "pyarrow/table.pxi":793
 *         cdef shared_ptr[CRecordBatch] result
 * 
 *         if offset < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError('Offset must be non-negative')
 * 
 */
  }

  /* "pyarrow/table.pxi":796
 *             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":797
 * 
 *         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(12, 797, __pyx_L1_error)
    __pyx_v_result = __pyx_v_self->batch->Slice(__pyx_t_4);

    /* "pyarrow/table.pxi":796
 *             raise IndexError('Offset must be non-negative')
 * 
 *         if length is None:             # <<<<<<<<<<<<<<
 *             result = self.batch.Slice(offset)
 *         else:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/table.pxi":799
 *             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(12, 799, __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(12, 799, __pyx_L1_error)
    __pyx_v_result = __pyx_v_self->batch->Slice(__pyx_t_4, __pyx_t_5);
  }
  __pyx_L4:;

  /* "pyarrow/table.pxi":801
 *             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(12, 801, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":775
 *         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":803
 *         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(12, 803, __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":805
 *     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":806
 *         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":809
 *             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":810
 * 
 *         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":809
 *             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":812
 *             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(12, 812, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":803
 *         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":814
 *         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":822
 *         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(12, 822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_entries = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":823
 *         """
 *         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":824
 *         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(12, 824, __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(12, 824, __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(12, 824, __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":825
 *         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(12, 825, __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(12, 825, __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(12, 825, __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":826
 *             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(12, 826, __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(12, 826, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyarrow/table.pxi":827
 *             column = self[i].to_pylist()
 *             entries.append((name, column))
 *         return OrderedDict(entries)             # <<<<<<<<<<<<<<
 * 
 *     def _to_pandas(self, options, **kwargs):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 827, __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(12, 827, __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":814
 *         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":829
 *         return OrderedDict(entries)
 * 
 *     def _to_pandas(self, options, **kwargs):             # <<<<<<<<<<<<<<
 *         return Table.from_batches([self])._to_pandas(options, **kwargs)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_23_to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11RecordBatch_22_to_pandas[] = "RecordBatch._to_pandas(self, options, **kwargs)";
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_23_to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_options = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_to_pandas (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_options,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "_to_pandas") < 0)) __PYX_ERR(12, 829, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_options = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_to_pandas", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 829, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch._to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_22_to_pandas(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self), __pyx_v_options, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_22_to_pandas(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, PyObject *__pyx_v_options, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("_to_pandas", 0);

  /* "pyarrow/table.pxi":830
 * 
 *     def _to_pandas(self, options, **kwargs):
 *         return Table.from_batches([self])._to_pandas(options, **kwargs)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Table), __pyx_n_s_from_batches); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 830, __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(12, 830, __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(12, 830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_options);
  __Pyx_GIVEREF(__pyx_v_options);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_options);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 830, __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":829
 *         return OrderedDict(entries)
 * 
 *     def _to_pandas(self, options, **kwargs):             # <<<<<<<<<<<<<<
 *         return Table.from_batches([self])._to_pandas(options, **kwargs)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch._to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":833
 * 
 *     @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":834
 *     @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(12, 833, __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(12, 833, __pyx_L3_error)
    } else {

      /* "pyarrow/table.pxi":833
 * 
 *     @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(12, 833, __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(12, 833, __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_dataframe_to_arrays = NULL;
  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":857
 *         pyarrow.RecordBatch
 *         """
 *         from pyarrow.pandas_compat import dataframe_to_arrays             # <<<<<<<<<<<<<<
 *         names, arrays, metadata = dataframe_to_arrays(
 *             df, schema, preserve_index, nthreads=nthreads, columns=columns
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 857, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_dataframe_to_arrays);
  __Pyx_GIVEREF(__pyx_n_s_dataframe_to_arrays);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_dataframe_to_arrays);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_pyarrow_pandas_compat, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 857, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_dataframe_to_arrays); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 857, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_dataframe_to_arrays = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":859
 *         from pyarrow.pandas_compat import dataframe_to_arrays
 *         names, arrays, metadata = dataframe_to_arrays(
 *             df, schema, preserve_index, nthreads=nthreads, columns=columns             # <<<<<<<<<<<<<<
 *         )
 *         return cls.from_arrays(arrays, names, metadata)
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_preserve_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pyarrow/table.pxi":858
 *         """
 *         from pyarrow.pandas_compat import dataframe_to_arrays
 *         names, arrays, metadata = dataframe_to_arrays(             # <<<<<<<<<<<<<<
 *             df, schema, preserve_index, nthreads=nthreads, columns=columns
 *         )
 */
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 858, __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);
  __Pyx_INCREF(((PyObject *)__pyx_v_schema));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_schema));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_schema));
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":859
 *         from pyarrow.pandas_compat import dataframe_to_arrays
 *         names, arrays, metadata = dataframe_to_arrays(
 *             df, schema, preserve_index, nthreads=nthreads, columns=columns             # <<<<<<<<<<<<<<
 *         )
 *         return cls.from_arrays(arrays, names, metadata)
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_nthreads, __pyx_v_nthreads) < 0) __PYX_ERR(12, 859, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_columns, __pyx_v_columns) < 0) __PYX_ERR(12, 859, __pyx_L1_error)

  /* "pyarrow/table.pxi":858
 *         """
 *         from pyarrow.pandas_compat import dataframe_to_arrays
 *         names, arrays, metadata = dataframe_to_arrays(             # <<<<<<<<<<<<<<
 *             df, schema, preserve_index, nthreads=nthreads, columns=columns
 *         )
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_dataframe_to_arrays, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 858, __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;
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(12, 858, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_4);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 858, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 858, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 858, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 858, __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_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(12, 858, __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(12, 858, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_names = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_arrays = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_metadata = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyarrow/table.pxi":861
 *             df, schema, preserve_index, nthreads=nthreads, columns=columns
 *         )
 *         return cls.from_arrays(arrays, names, 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(12, 861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __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_arrays, __pyx_v_names, __pyx_v_metadata};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 861, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_v_arrays, __pyx_v_names, __pyx_v_metadata};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 861, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  {
    __pyx_t_2 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 861, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__pyx_t_1) {
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = NULL;
    }
    __Pyx_INCREF(__pyx_v_arrays);
    __Pyx_GIVEREF(__pyx_v_arrays);
    PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_7, __pyx_v_arrays);
    __Pyx_INCREF(__pyx_v_names);
    __Pyx_GIVEREF(__pyx_v_names);
    PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_7, __pyx_v_names);
    __Pyx_INCREF(__pyx_v_metadata);
    __Pyx_GIVEREF(__pyx_v_metadata);
    PyTuple_SET_ITEM(__pyx_t_2, 2+__pyx_t_7, __pyx_v_metadata);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 861, __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_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":833
 * 
 *     @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_dataframe_to_arrays);
  __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":864
 * 
 *     @staticmethod
 *     def from_arrays(list arrays, names, 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, 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(12, 864, __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(12, 864, __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 = 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(12, 864, __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(12, 864, __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":886
 *             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(12, 886, __pyx_L1_error)
  }
  __pyx_t_1 = PyList_GET_SIZE(__pyx_v_arrays); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(12, 886, __pyx_L1_error)
  __pyx_v_number_of_arrays = __pyx_t_1;

  /* "pyarrow/table.pxi":888
 *             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(12, 888, __pyx_L1_error)
  }
  __pyx_t_1 = PyList_GET_SIZE(__pyx_v_arrays); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(12, 888, __pyx_L1_error)
  __pyx_t_2 = ((__pyx_t_1 > 0) != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":889
 * 
 *         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(12, 889, __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(12, 889, __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(12, 889, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_num_rows = __pyx_t_1;

    /* "pyarrow/table.pxi":888
 *             int64_t number_of_arrays = len(arrays)
 * 
 *         if len(arrays) > 0:             # <<<<<<<<<<<<<<
 *             num_rows = len(arrays[0])
 *         else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/table.pxi":891
 *             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":892
 *         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":893
 *             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":892
 *         else:
 *             num_rows = 0
 *         if isinstance(names, Schema):             # <<<<<<<<<<<<<<
 *             c_schema = (<Schema> names).sp_schema
 *         else:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/table.pxi":895
 *             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(12, 895, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L4:;

  /* "pyarrow/table.pxi":897
 *             _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(12, 897, __pyx_L1_error)
  }
  __pyx_t_1 = PyList_GET_SIZE(__pyx_v_arrays); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(12, 897, __pyx_L1_error)
  __pyx_v_c_arrays.reserve(__pyx_t_1);

  /* "pyarrow/table.pxi":898
 * 
 *         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(12, 898, __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(12, 898, __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(12, 898, __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(12, 898, __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":899
 *         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(12, 899, __pyx_L1_error)
    __pyx_t_4 = ((__pyx_t_7 != __pyx_v_num_rows) != 0);
    if (unlikely(__pyx_t_4)) {

      /* "pyarrow/table.pxi":901
 *             if len(arr) != num_rows:
 *                 raise ValueError('Arrays were not all the same length: '
 *                                  '{0} vs {1}'.format(len(arr), num_rows))             # <<<<<<<<<<<<<<
 *             c_arrays.push_back(arr.sp_array)
 * 
 */
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Arrays_were_not_all_the_same_len, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 901, __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(12, 901, __pyx_L1_error)
      __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(12, 901, __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(12, 901, __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(12, 901, __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(12, 901, __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(12, 901, __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(12, 901, __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":900
 *         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(12, 900, __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(12, 900, __pyx_L1_error)

      /* "pyarrow/table.pxi":899
 *         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":902
 *                 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(12, 902, __pyx_L1_error)
    }

    /* "pyarrow/table.pxi":898
 * 
 *         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":904
 *             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":905
 * 
 *         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(12, 904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":864
 * 
 *     @staticmethod
 *     def from_arrays(list arrays, names, 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":908
 * 
 * 
 * def _reconstruct_record_batch(columns, schema):             # <<<<<<<<<<<<<<
 *     """
 *     Internal: reconstruct RecordBatch from pickled components.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_103_reconstruct_record_batch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_102_reconstruct_record_batch[] = "_reconstruct_record_batch(columns, schema)\n\n    Internal: reconstruct RecordBatch from pickled components.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_103_reconstruct_record_batch = {"_reconstruct_record_batch", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_103_reconstruct_record_batch, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_102_reconstruct_record_batch};
static PyObject *__pyx_pw_7pyarrow_3lib_103_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(12, 908, __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(12, 908, __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(12, 908, __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_102_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_102_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":912
 *     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(12, 912, __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(12, 912, __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(12, 912, __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, 912, __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(12, 912, __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":908
 * 
 * 
 * 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":915
 * 
 * 
 * def table_to_blocks(PandasOptions options, Table table,             # <<<<<<<<<<<<<<
 *                     MemoryPool memory_pool, categories):
 *     cdef:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_105table_to_blocks(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_104table_to_blocks[] = "table_to_blocks(PandasOptions options, Table table, MemoryPool memory_pool, categories)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_105table_to_blocks = {"table_to_blocks", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_105table_to_blocks, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_104table_to_blocks};
static PyObject *__pyx_pw_7pyarrow_3lib_105table_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(12, 915, __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(12, 915, __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(12, 915, __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(12, 915, __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(12, 915, __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(12, 915, __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(12, 915, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(12, 916, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_104table_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_104table_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_9genexpr11__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":919
 *     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":923
 *         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":924
 * 
 *     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(12, 924, __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(12, 924, __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(12, 924, __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(12, 924, __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(12, 924, __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(12, 924, __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(12, 924, __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(12, 924, __pyx_L6_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_8);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr11__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(12, 924, __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_9genexpr11__pyx_v_cat) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_9genexpr11__pyx_v_cat);
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 924, __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(12, 924, __pyx_L6_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_cat); __pyx_9genexpr11__pyx_v_cat = 0;
      goto __pyx_L9_exit_scope;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_cat); __pyx_9genexpr11__pyx_v_cat = 0;
      goto __pyx_L1_error;
      __pyx_L9_exit_scope:;
    } /* exit inner scope */
    __pyx_t_11 = __pyx_convert_unordered_set_from_py_std_3a__3a_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(12, 924, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_categorical_columns = __pyx_t_11;

    /* "pyarrow/table.pxi":923
 *         unordered_set[c_string] categorical_columns
 * 
 *     if categories is not None:             # <<<<<<<<<<<<<<
 *         categorical_columns = {tobytes(cat) for cat in categories}
 * 
 */
  }

  /* "pyarrow/table.pxi":926
 *         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":927
 * 
 *     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":928
 *     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(12, 928, __pyx_L11_error)
      }

      /* "pyarrow/table.pxi":927
 * 
 *     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":933
 *         )
 * 
 *     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(12, 933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":915
 * 
 * 
 * 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_9genexpr11__pyx_v_cat);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":946
 *     """
 * 
 *     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":947
 * 
 *     def __cinit__(self):
 *         self.table = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self):
 */
  __pyx_v_self->table = NULL;

  /* "pyarrow/table.pxi":946
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.table = NULL
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":949
 *         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":950
 * 
 *     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__139, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 950, __pyx_L1_error)
  __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, 950, __pyx_L1_error)

  /* "pyarrow/table.pxi":949
 *         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":953
 *                         "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":954
 * 
 *     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_u_pyarrow, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 954, __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(12, 954, __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(12, 954, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 954, __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(12, 954, __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(12, 954, __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(12, 954, __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(12, 954, __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":953
 *                         "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":956
 *         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":957
 * 
 *     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":958
 *     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":956
 *         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":960
 *         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":964
 *         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":965
 *         """
 *         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(12, 965, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":964
 *         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":960
 *         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":967
 *             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_9genexpr12__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":970
 *         # 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)
 * 
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 970, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_columns); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 970, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 970, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 970, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(12, 970, __pyx_L5_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 970, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(12, 970, __pyx_L5_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 970, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_5(__pyx_t_3);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(12, 970, __pyx_L5_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr12__pyx_v_col, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr12__pyx_v_col, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 970, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(12, 970, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_col); __pyx_9genexpr12__pyx_v_col = 0;
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_col); __pyx_9genexpr12__pyx_v_col = 0;
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __pyx_v_columns = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":971
 *         # data twice
 *         columns = [col.data for col in self.columns]
 *         return _reconstruct_table, (columns, self.schema)             # <<<<<<<<<<<<<<
 * 
 *     def replace_schema_metadata(self, metadata=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_reconstruct_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 971, __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(12, 971, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 971, __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(12, 971, __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":967
 *             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_9genexpr12__pyx_v_col);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":973
 *         return _reconstruct_table, (columns, self.schema)
 * 
 *     def replace_schema_metadata(self, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         EXPERIMENTAL: Create shallow copy of table by replacing schema
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_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, 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(12, 973, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_metadata = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("replace_schema_metadata", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 973, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table.replace_schema_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_10replace_schema_metadata(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), __pyx_v_metadata);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_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_c_table;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("replace_schema_metadata", 0);

  /* "pyarrow/table.pxi":991
 *             shared_ptr[CTable] c_table
 * 
 *         if metadata is not None:             # <<<<<<<<<<<<<<
 *             if not isinstance(metadata, dict):
 *                 raise TypeError('Metadata must be an instance of dict')
 */
  __pyx_t_1 = (__pyx_v_metadata != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":992
 * 
 *         if metadata is not None:
 *             if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *                 raise TypeError('Metadata must be an instance of dict')
 *             c_meta = pyarrow_unwrap_metadata(metadata)
 */
    __pyx_t_2 = PyDict_Check(__pyx_v_metadata); 
    __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
    if (unlikely(__pyx_t_1)) {

      /* "pyarrow/table.pxi":993
 *         if metadata is not None:
 *             if not isinstance(metadata, dict):
 *                 raise TypeError('Metadata must be an instance of dict')             # <<<<<<<<<<<<<<
 *             c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 993, __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(12, 993, __pyx_L1_error)

      /* "pyarrow/table.pxi":992
 * 
 *         if metadata is not None:
 *             if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *                 raise TypeError('Metadata must be an instance of dict')
 *             c_meta = pyarrow_unwrap_metadata(metadata)
 */
    }

    /* "pyarrow/table.pxi":994
 *             if not isinstance(metadata, dict):
 *                 raise TypeError('Metadata must be an instance of dict')
 *             c_meta = pyarrow_unwrap_metadata(metadata)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
    __pyx_v_c_meta = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_metadata(__pyx_v_metadata);

    /* "pyarrow/table.pxi":991
 *             shared_ptr[CTable] c_table
 * 
 *         if metadata is not None:             # <<<<<<<<<<<<<<
 *             if not isinstance(metadata, dict):
 *                 raise TypeError('Metadata must be an instance of dict')
 */
  }

  /* "pyarrow/table.pxi":996
 *             c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_table = self.table.ReplaceSchemaMetadata(c_meta)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":997
 * 
 *         with nogil:
 *             c_table = self.table.ReplaceSchemaMetadata(c_meta)             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_table(c_table)
 */
        __pyx_v_c_table = __pyx_v_self->table->ReplaceSchemaMetadata(__pyx_v_c_meta);
      }

      /* "pyarrow/table.pxi":996
 *             c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_table = self.table.ReplaceSchemaMetadata(c_meta)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/table.pxi":999
 *             c_table = self.table.ReplaceSchemaMetadata(c_meta)
 * 
 *         return pyarrow_wrap_table(c_table)             # <<<<<<<<<<<<<<
 * 
 *     def flatten(self, MemoryPool memory_pool=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_c_table); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":973
 *         return _reconstruct_table, (columns, self.schema)
 * 
 *     def replace_schema_metadata(self, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         EXPERIMENTAL: Create shallow copy of table by replacing schema
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Table.replace_schema_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1001
 *         return pyarrow_wrap_table(c_table)
 * 
 *     def flatten(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Flatten this Table.  Each column with a struct type is flattened
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_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(12, 1001, __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(12, 1001, __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(12, 1001, __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":1017
 *         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":1019
 *             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":1020
 * 
 *         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(12, 1020, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":1019
 *             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":1022
 *             check_status(self.table.Flatten(pool, &flattened))
 * 
 *         return pyarrow_wrap_table(flattened)             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, 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(12, 1022, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1001
 *         return pyarrow_wrap_table(c_table)
 * 
 *     def flatten(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Flatten this Table.  Each column with a struct type is flattened
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Table.flatten", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1024
 *         return pyarrow_wrap_table(flattened)
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         try:
 *             return self.equals(other)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_15__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_15__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_14__eq__(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), ((PyObject *)__pyx_v_other));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_14__eq__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "pyarrow/table.pxi":1025
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "pyarrow/table.pxi":1026
 *     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(12, 1026, __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(12, 1026, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "pyarrow/table.pxi":1025
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/table.pxi":1027
 *         try:
 *             return self.equals(other)
 *         except TypeError:             # <<<<<<<<<<<<<<
 *             return NotImplemented
 * 
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pyarrow.lib.Table.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(12, 1027, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "pyarrow/table.pxi":1028
 *             return self.equals(other)
 *         except TypeError:
 *             return NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     def equals(self, Table other):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_builtin_NotImplemented);
      __pyx_r = __pyx_builtin_NotImplemented;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/table.pxi":1025
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "pyarrow/table.pxi":1024
 *         return pyarrow_wrap_table(flattened)
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         try:
 *             return self.equals(other)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.Table.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1030
 *             return NotImplemented
 * 
 *     def equals(self, Table other):             # <<<<<<<<<<<<<<
 *         """
 *         Check if contents of two tables are equal
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_17equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_16equals[] = "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_17equals(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(12, 1030, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_16equals(((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_16equals(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_other) {
   arrow::Table *__pyx_v_this_table;
   arrow::Table *__pyx_v_other_table;
  bool __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
   arrow::Table *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/table.pxi":1043
 *         """
 *         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":1044
 *         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":1047
 *             c_bool result
 * 
 *         if other is None:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_other) == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/table.pxi":1048
 * 
 *         if other is None:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":1047
 *             c_bool result
 * 
 *         if other is None:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  }

  /* "pyarrow/table.pxi":1050
 *             return False
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = this_table.Equals(deref(other_table))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":1051
 * 
 *         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":1050
 *             return False
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = this_table.Equals(deref(other_table))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L6;
        }
        __pyx_L6:;
      }
  }

  /* "pyarrow/table.pxi":1053
 *             result = this_table.Equals(deref(other_table))
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def cast(self, Schema target_schema, bint safe=True):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1030
 *             return NotImplemented
 * 
 *     def equals(self, Table other):             # <<<<<<<<<<<<<<
 *         """
 *         Check if contents of two tables are equal
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.Table.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1055
 *         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_19cast(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_18cast[] = "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_19cast(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(12, 1055, __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(12, 1055, __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(12, 1055, __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(12, 1055, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_18cast(((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_18cast(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":1073
 *             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(12, 1073, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_newcols = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1075
 *             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(12, 1075, __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(12, 1075, __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(12, 1075, __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(12, 1075, __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(12, 1075, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(__pyx_t_4)) {

    /* "pyarrow/table.pxi":1078
 *             raise ValueError("Target schema's field names are not matching "
 *                              "the table's field names: {!r}, {!r}"
 *                              .format(self.schema.names, target_schema.names))             # <<<<<<<<<<<<<<
 * 
 *         for column, field in zip(self.itercolumns(), target_schema):
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Target_schema_s_field_names_are, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1078, __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(12, 1078, __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(12, 1078, __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(12, 1078, __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(12, 1078, __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(12, 1078, __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(12, 1078, __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(12, 1078, __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":1076
 * 
 *         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(12, 1076, __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(12, 1076, __pyx_L1_error)

    /* "pyarrow/table.pxi":1075
 *             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":1080
 *                              .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(12, 1080, __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(12, 1080, __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(12, 1080, __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(12, 1080, __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(12, 1080, __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(12, 1080, __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(12, 1080, __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(12, 1080, __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(12, 1080, __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(12, 1080, __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(12, 1080, __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(12, 1080, __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(12, 1080, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1080, __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(12, 1080, __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(12, 1080, __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(12, 1080, __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(12, 1080, __pyx_L1_error)
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(12, 1080, __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":1081
 * 
 *         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(12, 1081, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1081, __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(12, 1081, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_safe); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 1081, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_safe, __pyx_t_5) < 0) __PYX_ERR(12, 1081, __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(12, 1081, __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(12, 1081, __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":1082
 *         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(12, 1082, __pyx_L1_error)

    /* "pyarrow/table.pxi":1080
 *                              .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":1084
 *             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(12, 1084, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 1084, __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(12, 1084, __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(12, 1084, __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(12, 1084, __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":1055
 *         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":1087
 * 
 *     @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_21from_pandas(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_20from_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_21from_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":1088
 *     @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(12, 1087, __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(12, 1087, __pyx_L3_error)
    } else {

      /* "pyarrow/table.pxi":1087
 * 
 *     @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(12, 1088, __pyx_L3_error)
    } else {

      /* "pyarrow/table.pxi":1088
 *     @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(12, 1087, __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(12, 1087, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_20from_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":1087
 * 
 *     @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_20from_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_dataframe_to_arrays = NULL;
  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":1138
 *         <pyarrow.lib.Table object at 0x7f05d1fb1b40>
 *         """
 *         from pyarrow.pandas_compat import dataframe_to_arrays             # <<<<<<<<<<<<<<
 *         names, arrays, metadata = dataframe_to_arrays(
 *             df,
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_dataframe_to_arrays);
  __Pyx_GIVEREF(__pyx_n_s_dataframe_to_arrays);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_dataframe_to_arrays);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_pyarrow_pandas_compat, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_dataframe_to_arrays); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_dataframe_to_arrays = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":1139
 *         """
 *         from pyarrow.pandas_compat import dataframe_to_arrays
 *         names, arrays, metadata = dataframe_to_arrays(             # <<<<<<<<<<<<<<
 *             df,
 *             schema=schema,
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_df);
  __Pyx_GIVEREF(__pyx_v_df);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_df);

  /* "pyarrow/table.pxi":1141
 *         names, arrays, metadata = dataframe_to_arrays(
 *             df,
 *             schema=schema,             # <<<<<<<<<<<<<<
 *             preserve_index=preserve_index,
 *             nthreads=nthreads,
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_schema, ((PyObject *)__pyx_v_schema)) < 0) __PYX_ERR(12, 1141, __pyx_L1_error)

  /* "pyarrow/table.pxi":1142
 *             df,
 *             schema=schema,
 *             preserve_index=preserve_index,             # <<<<<<<<<<<<<<
 *             nthreads=nthreads,
 *             columns=columns,
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_preserve_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_preserve_index, __pyx_t_3) < 0) __PYX_ERR(12, 1141, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/table.pxi":1143
 *             schema=schema,
 *             preserve_index=preserve_index,
 *             nthreads=nthreads,             # <<<<<<<<<<<<<<
 *             columns=columns,
 *             safe=safe
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_nthreads, __pyx_v_nthreads) < 0) __PYX_ERR(12, 1141, __pyx_L1_error)

  /* "pyarrow/table.pxi":1144
 *             preserve_index=preserve_index,
 *             nthreads=nthreads,
 *             columns=columns,             # <<<<<<<<<<<<<<
 *             safe=safe
 *         )
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_columns, __pyx_v_columns) < 0) __PYX_ERR(12, 1141, __pyx_L1_error)

  /* "pyarrow/table.pxi":1145
 *             nthreads=nthreads,
 *             columns=columns,
 *             safe=safe             # <<<<<<<<<<<<<<
 *         )
 *         return cls.from_arrays(arrays, names=names, metadata=metadata)
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_safe); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_safe, __pyx_t_3) < 0) __PYX_ERR(12, 1141, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/table.pxi":1139
 *         """
 *         from pyarrow.pandas_compat import dataframe_to_arrays
 *         names, arrays, metadata = dataframe_to_arrays(             # <<<<<<<<<<<<<<
 *             df,
 *             schema=schema,
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_dataframe_to_arrays, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(12, 1139, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_4);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1139, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1139, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1139, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 1139, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(12, 1139, __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(12, 1139, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_names = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_arrays = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_metadata = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyarrow/table.pxi":1147
 *             safe=safe
 *         )
 *         return cls.from_arrays(arrays, names=names, metadata=metadata)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_arrays);
  __Pyx_GIVEREF(__pyx_v_arrays);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_arrays);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_names, __pyx_v_names) < 0) __PYX_ERR(12, 1147, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_metadata, __pyx_v_metadata) < 0) __PYX_ERR(12, 1147, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1087
 * 
 *     @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_dataframe_to_arrays);
  __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":1150
 * 
 *     @staticmethod
 *     def from_arrays(arrays, names=None, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a Table from Arrow arrays or columns
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_23from_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_22from_arrays[] = "Table.from_arrays(arrays, names=None, schema=None, 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        schema : Schema, default None\n            If not passed, will be inferred from the arrays\n\n        Returns\n        -------\n        pyarrow.Table\n\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_5Table_23from_arrays = {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_23from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_22from_arrays};
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_23from_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(12, 1150, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_arrays = values[0];
    __pyx_v_names = values[1];
    __pyx_v_schema = values[2];
    __pyx_v_metadata = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_arrays", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 1150, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table.from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_22from_arrays(__pyx_v_arrays, __pyx_v_names, __pyx_v_schema, __pyx_v_metadata);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_22from_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":1173
 *             Schema cy_schema
 *             shared_ptr[CSchema] c_schema
 *             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(12, 1173, __pyx_L1_error)
  __pyx_v_K = ((int)__pyx_t_1);

  /* "pyarrow/table.pxi":1175
 *             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":1176
 * 
 *         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(12, 1176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/table.pxi":1175
 *             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":1177
 *         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":1178
 *             _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":1179
 *         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__140, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1179, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(12, 1179, __pyx_L1_error)

      /* "pyarrow/table.pxi":1178
 *             _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":1180
 *             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(12, 1180, __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":1182
 *             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(12, 1182, __pyx_L1_error)
    __pyx_t_5 = PyObject_Length(__pyx_v_arrays); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(12, 1182, __pyx_L1_error)
    __pyx_t_3 = ((__pyx_t_1 != __pyx_t_5) != 0);
    if (unlikely(__pyx_t_3)) {

      /* "pyarrow/table.pxi":1183
 * 
 *             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__141, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1183, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(12, 1183, __pyx_L1_error)

      /* "pyarrow/table.pxi":1182
 *             cy_schema = schema
 * 
 *             if len(schema) != len(arrays):             # <<<<<<<<<<<<<<
 *                 raise ValueError('Schema and number of arrays unequal')
 * 
 */
    }

    /* "pyarrow/table.pxi":1185
 *                 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":1177
 *         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":1187
 *             c_schema = cy_schema.sp_schema
 * 
 *         columns.reserve(K)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(K):
 */
  __pyx_v_columns.reserve(__pyx_v_K);

  /* "pyarrow/table.pxi":1189
 *         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":1190
 * 
 *         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(12, 1190, __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":1194
 *                     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(12, 1194, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);

      /* "pyarrow/table.pxi":1192
 *             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(12, 1192, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "pyarrow/table.pxi":1191
 *         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(12, 1191, __pyx_L1_error)
      }

      /* "pyarrow/table.pxi":1190
 * 
 *         for i in range(K):
 *             if isinstance(arrays[i], Array):             # <<<<<<<<<<<<<<
 *                 columns.push_back(
 *                     make_shared[CColumn](
 */
      goto __pyx_L8;
    }

    /* "pyarrow/table.pxi":1197
 *                     )
 *                 )
 *             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(12, 1197, __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":1201
 *                     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(12, 1201, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);

      /* "pyarrow/table.pxi":1199
 *             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(12, 1199, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "pyarrow/table.pxi":1198
 *                 )
 *             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(12, 1198, __pyx_L1_error)
      }

      /* "pyarrow/table.pxi":1197
 *                     )
 *                 )
 *             elif isinstance(arrays[i], ChunkedArray):             # <<<<<<<<<<<<<<
 *                 columns.push_back(
 *                     make_shared[CColumn](
 */
      goto __pyx_L8;
    }

    /* "pyarrow/table.pxi":1204
 *                     )
 *                 )
 *             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(12, 1204, __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":1209
 *                     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(12, 1209, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);

      /* "pyarrow/table.pxi":1207
 *                 # 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(12, 1207, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "pyarrow/table.pxi":1206
 *             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(12, 1206, __pyx_L1_error)
      }

      /* "pyarrow/table.pxi":1204
 *                     )
 *                 )
 *             elif isinstance(arrays[i], Column):             # <<<<<<<<<<<<<<
 *                 # Make sure schema field and column are consistent
 *                 columns.push_back(
 */
      goto __pyx_L8;
    }

    /* "pyarrow/table.pxi":1213
 *                 )
 *             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(12, 1213, __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(12, 1213, __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(12, 1213, __pyx_L1_error)
    }
    __pyx_L8:;
  }

  /* "pyarrow/table.pxi":1215
 *                 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(12, 1215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_r = __pyx_t_11;
  __pyx_t_11 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1150
 * 
 *     @staticmethod
 *     def from_arrays(arrays, names=None, schema=None, 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":1218
 * 
 *     @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_25from_batches(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_24from_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_25from_batches = {"from_batches", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_25from_batches, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_24from_batches};
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_25from_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(12, 1218, __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(12, 1218, __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(12, 1218, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_24from_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_24from_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":1239
 *             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(12, 1239, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1239, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(12, 1239, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1239, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(12, 1239, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1239, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(12, 1239, __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(12, 1239, __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":1240
 * 
 *         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(12, 1240, __pyx_L1_error)
    }

    /* "pyarrow/table.pxi":1239
 *             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":1242
 *             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":1243
 * 
 *         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":1244
 *         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__142, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1244, __pyx_L1_error)
      __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, 1244, __pyx_L1_error)

      /* "pyarrow/table.pxi":1243
 * 
 *         if schema is None:
 *             if c_batches.size() == 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError('Must pass schema, or at least '
 *                                  'one RecordBatch')
 */
    }

    /* "pyarrow/table.pxi":1246
 *                 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":1242
 *             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":1248
 *             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":1250
 *             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":1251
 * 
 *         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(12, 1251, __pyx_L8_error)
      }

      /* "pyarrow/table.pxi":1250
 *             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":1254
 *                                                   &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(12, 1254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1218
 * 
 *     @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":1256
 *         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_27to_batches(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_26to_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_27to_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(12, 1256, __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(12, 1256, __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_26to_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_26to_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":1274
 *             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(12, 1274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1277
 *             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":1279
 *         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":1280
 * 
 *         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(12, 1280, __pyx_L1_error)
    __pyx_v_c_chunksize = __pyx_t_4;

    /* "pyarrow/table.pxi":1281
 *         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":1279
 *         reader.reset(new TableBatchReader(deref(self.table)))
 * 
 *         if chunksize is not None:             # <<<<<<<<<<<<<<
 *             c_chunksize = chunksize
 *             reader.get().set_chunksize(c_chunksize)
 */
  }

  /* "pyarrow/table.pxi":1283
 *             reader.get().set_chunksize(c_chunksize)
 * 
 *         while True:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(reader.get().ReadNext(&batch))
 */
  while (1) {

    /* "pyarrow/table.pxi":1284
 * 
 *         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":1285
 *         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(12, 1285, __pyx_L9_error)
        }

        /* "pyarrow/table.pxi":1284
 * 
 *         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":1287
 *                 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":1288
 * 
 *             if batch.get() == NULL:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             result.append(pyarrow_wrap_batch(batch))
 */
      goto __pyx_L5_break;

      /* "pyarrow/table.pxi":1287
 *                 check_status(reader.get().ReadNext(&batch))
 * 
 *             if batch.get() == NULL:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    }

    /* "pyarrow/table.pxi":1290
 *                 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(12, 1290, __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(12, 1290, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L5_break:;

  /* "pyarrow/table.pxi":1292
 *             result.append(pyarrow_wrap_batch(batch))
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def _to_pandas(self, options, categories=None, ignore_metadata=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1256
 *         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":1294
 *         return result
 * 
 *     def _to_pandas(self, options, categories=None, ignore_metadata=False):             # <<<<<<<<<<<<<<
 *         from pyarrow.pandas_compat import table_to_blockmanager
 *         mgr = table_to_blockmanager(
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_29_to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_28_to_pandas[] = "Table._to_pandas(self, options, categories=None, ignore_metadata=False)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_29_to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_options = 0;
  PyObject *__pyx_v_categories = 0;
  PyObject *__pyx_v_ignore_metadata = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_to_pandas (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_options,&__pyx_n_s_categories,&__pyx_n_s_ignore_metadata,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_categories);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ignore_metadata);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_to_pandas") < 0)) __PYX_ERR(12, 1294, __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_options = values[0];
    __pyx_v_categories = values[1];
    __pyx_v_ignore_metadata = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_to_pandas", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 1294, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table._to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_28_to_pandas(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), __pyx_v_options, __pyx_v_categories, __pyx_v_ignore_metadata);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_28_to_pandas(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_options, PyObject *__pyx_v_categories, PyObject *__pyx_v_ignore_metadata) {
  PyObject *__pyx_v_table_to_blockmanager = NULL;
  PyObject *__pyx_v_mgr = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("_to_pandas", 0);

  /* "pyarrow/table.pxi":1295
 * 
 *     def _to_pandas(self, options, categories=None, ignore_metadata=False):
 *         from pyarrow.pandas_compat import table_to_blockmanager             # <<<<<<<<<<<<<<
 *         mgr = table_to_blockmanager(
 *             options, self, categories,
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_table_to_blockmanager);
  __Pyx_GIVEREF(__pyx_n_s_table_to_blockmanager);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_table_to_blockmanager);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_pyarrow_pandas_compat, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_table_to_blockmanager); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_table_to_blockmanager = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":1296
 *     def _to_pandas(self, options, categories=None, ignore_metadata=False):
 *         from pyarrow.pandas_compat import table_to_blockmanager
 *         mgr = table_to_blockmanager(             # <<<<<<<<<<<<<<
 *             options, self, categories,
 *             ignore_metadata=ignore_metadata)
 */
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_options);
  __Pyx_GIVEREF(__pyx_v_options);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_options);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_categories);
  __Pyx_GIVEREF(__pyx_v_categories);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_categories);

  /* "pyarrow/table.pxi":1298
 *         mgr = table_to_blockmanager(
 *             options, self, categories,
 *             ignore_metadata=ignore_metadata)             # <<<<<<<<<<<<<<
 *         return pandas_api.data_frame(mgr)
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ignore_metadata, __pyx_v_ignore_metadata) < 0) __PYX_ERR(12, 1298, __pyx_L1_error)

  /* "pyarrow/table.pxi":1296
 *     def _to_pandas(self, options, categories=None, ignore_metadata=False):
 *         from pyarrow.pandas_compat import table_to_blockmanager
 *         mgr = table_to_blockmanager(             # <<<<<<<<<<<<<<
 *             options, self, categories,
 *             ignore_metadata=ignore_metadata)
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_table_to_blockmanager, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_mgr = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyarrow/table.pxi":1299
 *             options, self, categories,
 *             ignore_metadata=ignore_metadata)
 *         return pandas_api.data_frame(mgr)             # <<<<<<<<<<<<<<
 * 
 *     def to_pydict(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_7pyarrow_3lib_pandas_api), __pyx_n_s_data_frame); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_v_mgr) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_mgr);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1294
 *         return result
 * 
 *     def _to_pandas(self, options, categories=None, ignore_metadata=False):             # <<<<<<<<<<<<<<
 *         from pyarrow.pandas_compat import table_to_blockmanager
 *         mgr = table_to_blockmanager(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Table._to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_table_to_blockmanager);
  __Pyx_XDECREF(__pyx_v_mgr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1301
 *         return pandas_api.data_frame(mgr)
 * 
 *     def to_pydict(self):             # <<<<<<<<<<<<<<
 *         """
 *         Converted the arrow::Table to an OrderedDict
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_31to_pydict(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_30to_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_31to_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_30to_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_30to_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":1311
 *         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":1312
 *             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(12, 1312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_entries = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1315
 *             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":1316
 * 
 *         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(12, 1316, __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(12, 1316, __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(12, 1316, __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(12, 1316, __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":1317
 *         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(12, 1317, __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(12, 1317, __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(12, 1317, __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(12, 1317, __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(12, 1317, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }

  /* "pyarrow/table.pxi":1319
 *             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(12, 1319, __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(12, 1319, __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":1301
 *         return pandas_api.data_frame(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":1322
 * 
 *     @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":1330
 *         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(12, 1330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1322
 * 
 *     @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":1332
 *         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_33column(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_32column[] = "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_33column(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_32column(((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_32column(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":1344
 *         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(12, 1344, __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(12, 1344, __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(12, 1344, __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":1345
 *         """
 *         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(12, 1345, __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(12, 1345, __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(12, 1345, __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":1346
 *         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(12, 1346, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(12, 1346, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(__pyx_t_4)) {

      /* "pyarrow/table.pxi":1347
 *             field_index = self.schema.get_field_index(i)
 *             if field_index < 0:
 *                 raise KeyError("Column {} does not exist in table".format(i))             # <<<<<<<<<<<<<<
 *             else:
 *                 return self._column(field_index)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Column_does_not_exist_in_table, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 1347, __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(12, 1347, __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(12, 1347, __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(12, 1347, __pyx_L1_error)

      /* "pyarrow/table.pxi":1346
 *         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":1349
 *                 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(12, 1349, __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(12, 1349, __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":1344
 *         pyarrow.Column
 *         """
 *         if isinstance(i, six.string_types):             # <<<<<<<<<<<<<<
 *             field_index = self.schema.get_field_index(i)
 *             if field_index < 0:
 */
  }

  /* "pyarrow/table.pxi":1350
 *             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(12, 1350, __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(12, 1350, __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(12, 1350, __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":1351
 *                 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(12, 1351, __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(12, 1351, __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":1350
 *             else:
 *                 return self._column(field_index)
 *         elif isinstance(i, six.integer_types):             # <<<<<<<<<<<<<<
 *             return self._column(i)
 *         else:
 */
  }

  /* "pyarrow/table.pxi":1353
 *             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__143, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1353, __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, 1353, __pyx_L1_error)
  }

  /* "pyarrow/table.pxi":1332
 *         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":1355
 *             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_35_column(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_34_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_35_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(12, 1355, __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_34_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_34_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":1368
 *         """
 *         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(12, 1368, __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(12, 1368, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_num_columns = __pyx_t_2;

  /* "pyarrow/table.pxi":1371
 *             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":1373
 *         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_u_Table_column_index_d_is_out_of_r, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 1373, __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(12, 1373, __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(12, 1373, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pyarrow/table.pxi":1372
 * 
 *         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(12, 1372, __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(12, 1372, __pyx_L1_error)

    /* "pyarrow/table.pxi":1371
 *             int index
 * 
 *         if not -num_columns <= i < num_columns:             # <<<<<<<<<<<<<<
 *             raise IndexError(
 *                 'Table column index {:d} is out of range'.format(i)
 */
  }

  /* "pyarrow/table.pxi":1376
 *             )
 * 
 *         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":1377
 * 
 *         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(12, 1377, __pyx_L1_error)
    }
  }
  #endif

  /* "pyarrow/table.pxi":1379
 *         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(12, 1379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1355
 *             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":1381
 *         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_37__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_37__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_36__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_36__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":1382
 * 
 *     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(12, 1382, __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(12, 1382, __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(12, 1382, __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(12, 1382, __pyx_L1_error)
  __pyx_v_index = ((int)__pyx_t_4);

  /* "pyarrow/table.pxi":1383
 *     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(12, 1383, __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(12, 1383, __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(12, 1383, __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":1381
 *         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_40generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/table.pxi":1385
 *         return self.column(index)
 * 
 *     def itercolumns(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterator over all columns in their numerical order
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_39itercolumns(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_38itercolumns[] = "Table.itercolumns(self)\n\n        Iterator over all columns in their numerical order\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_39itercolumns(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_38itercolumns(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_38itercolumns(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_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_8_itercolumns *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_8_itercolumns(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_8_itercolumns, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_itercolumns *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(12, 1385, __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_40generator7, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_itercolumns, __pyx_n_s_Table_itercolumns, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(12, 1385, __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_40generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_itercolumns *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_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(12, 1385, __pyx_L1_error)

  /* "pyarrow/table.pxi":1389
 *         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(12, 1389, __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(12, 1389, __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(12, 1389, __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(12, 1389, __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(12, 1389, __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(12, 1389, __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(12, 1389, __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(12, 1389, __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(12, 1389, __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":1390
 *         """
 *         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(12, 1390, __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(12, 1390, __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(12, 1390, __pyx_L1_error)

    /* "pyarrow/table.pxi":1389
 *         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":1385
 *         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":1393
 * 
 *     @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_9genexpr13__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":1401
 *         list of pa.Column
 *         """
 *         return [self._column(i) for i in range(self.num_columns)]             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 1401, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_columns); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1401, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1401, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1401, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 1401, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(12, 1401, __pyx_L5_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1401, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(12, 1401, __pyx_L5_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1401, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_5(__pyx_t_2);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(12, 1401, __pyx_L5_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr13__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(12, 1401, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_9genexpr13__pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_9genexpr13__pyx_v_i);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1401, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(12, 1401, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_i); __pyx_9genexpr13__pyx_v_i = 0;
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_i); __pyx_9genexpr13__pyx_v_i = 0;
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1393
 * 
 *     @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_9genexpr13__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1404
 * 
 *     @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":1412
 *         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(12, 1412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1404
 * 
 *     @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":1415
 * 
 *     @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":1426
 *         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(12, 1426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1415
 * 
 *     @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":1428
 *         return self.table.num_rows()
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.num_rows
 * 
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pyarrow_3lib_5Table_42__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_7pyarrow_3lib_5Table_42__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_41__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_41__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":1429
 * 
 *     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(12, 1429, __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(12, 1429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1428
 *         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":1432
 * 
 *     @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":1440
 *         (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(12, 1440, __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(12, 1440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1440, __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":1432
 * 
 *     @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":1442
 *         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_44add_column(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_43add_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_44add_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(12, 1442, __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(12, 1442, __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(12, 1442, __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(12, 1442, __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(12, 1442, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_43add_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_43add_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":1448
 *         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":1449
 * 
 *         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(12, 1449, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":1448
 *         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":1451
 *             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(12, 1451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1442
 *         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":1453
 *         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_46append_column(PyObject *__pyx_v_self, PyObject *__pyx_v_column); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_45append_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_46append_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(12, 1453, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_45append_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_45append_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":1457
 *         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(12, 1457, __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(12, 1457, __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(12, 1457, __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(12, 1457, __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(12, 1457, __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(12, 1457, __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":1453
 *         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":1459
 *         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_48remove_column(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_47remove_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_48remove_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(12, 1459, __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_47remove_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_47remove_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":1465
 *         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":1466
 * 
 *         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(12, 1466, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":1465
 *         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":1468
 *             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(12, 1468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1459
 *         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":1470
 *         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_50set_column(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_49set_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_50set_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(12, 1470, __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(12, 1470, __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(12, 1470, __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(12, 1470, __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(12, 1470, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_49set_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_49set_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":1476
 *         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":1477
 * 
 *         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(12, 1477, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":1476
 *         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":1479
 *             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(12, 1479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1470
 *         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":1481
 *         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_52drop(PyObject *__pyx_v_self, PyObject *__pyx_v_columns); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_51drop[] = "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_52drop(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_51drop(((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_51drop(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":1489
 *         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(12, 1489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_indices = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1490
 *         """
 *         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(12, 1490, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1490, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(12, 1490, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1490, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(12, 1490, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1490, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(12, 1490, __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":1491
 *         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(12, 1491, __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(12, 1491, __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(12, 1491, __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":1492
 *         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(12, 1492, __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(12, 1492, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(__pyx_t_7)) {

      /* "pyarrow/table.pxi":1493
 *             idx = self.schema.get_field_index(col)
 *             if idx == -1:
 *                 raise KeyError("Column {!r} not found".format(col))             # <<<<<<<<<<<<<<
 *             indices.append(idx)
 * 
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Column_r_not_found, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 1493, __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(12, 1493, __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(12, 1493, __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(12, 1493, __pyx_L1_error)

      /* "pyarrow/table.pxi":1492
 *         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":1494
 *             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(12, 1494, __pyx_L1_error)

    /* "pyarrow/table.pxi":1490
 *         """
 *         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":1496
 *             indices.append(idx)
 * 
 *         indices.sort()             # <<<<<<<<<<<<<<
 *         indices.reverse()
 * 
 */
  __pyx_t_8 = PyList_Sort(__pyx_v_indices); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(12, 1496, __pyx_L1_error)

  /* "pyarrow/table.pxi":1497
 * 
 *         indices.sort()
 *         indices.reverse()             # <<<<<<<<<<<<<<
 * 
 *         table = self
 */
  __pyx_t_8 = PyList_Reverse(__pyx_v_indices); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(12, 1497, __pyx_L1_error)

  /* "pyarrow/table.pxi":1499
 *         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":1500
 * 
 *         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(12, 1500, __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(12, 1500, __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":1501
 *         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(12, 1501, __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(12, 1501, __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":1500
 * 
 *         table = self
 *         for idx in indices:             # <<<<<<<<<<<<<<
 *             table = table.remove_column(idx)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1503
 *             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":1481
 *         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":1506
 * 
 * 
 * def _reconstruct_table(arrays, schema):             # <<<<<<<<<<<<<<
 *     """
 *     Internal: reconstruct pa.Table from pickled components.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_107_reconstruct_table(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_106_reconstruct_table[] = "_reconstruct_table(arrays, schema)\n\n    Internal: reconstruct pa.Table from pickled components.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_107_reconstruct_table = {"_reconstruct_table", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_107_reconstruct_table, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_106_reconstruct_table};
static PyObject *__pyx_pw_7pyarrow_3lib_107_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(12, 1506, __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(12, 1506, __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(12, 1506, __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_106_reconstruct_table(__pyx_self, __pyx_v_arrays, __pyx_v_schema);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_106_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":1510
 *     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(12, 1510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 1510, __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(12, 1510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_schema, __pyx_v_schema) < 0) __PYX_ERR(12, 1510, __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(12, 1510, __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":1506
 * 
 * 
 * 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":1513
 * 
 * 
 * def concat_tables(tables):             # <<<<<<<<<<<<<<
 *     """
 *     Perform zero-copy concatenation of pyarrow.Table objects. Raises exception
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_109concat_tables(PyObject *__pyx_self, PyObject *__pyx_v_tables); /*proto*/
static char __pyx_doc_7pyarrow_3lib_108concat_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_109concat_tables = {"concat_tables", (PyCFunction)__pyx_pw_7pyarrow_3lib_109concat_tables, METH_O, __pyx_doc_7pyarrow_3lib_108concat_tables};
static PyObject *__pyx_pw_7pyarrow_3lib_109concat_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_108concat_tables(__pyx_self, ((PyObject *)__pyx_v_tables));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_108concat_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":1529
 *         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(12, 1529, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 1529, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(12, 1529, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1529, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(12, 1529, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 1529, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(12, 1529, __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(12, 1529, __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":1530
 * 
 *     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(12, 1530, __pyx_L1_error)
    }

    /* "pyarrow/table.pxi":1529
 *         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":1532
 *         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":1533
 * 
 *     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(12, 1533, __pyx_L6_error)
      }

      /* "pyarrow/table.pxi":1532
 *         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":1535
 *         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(12, 1535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1513
 * 
 * 
 * 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":58
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.own_file = False
 *         self.is_readable = False
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_10NativeFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_10NativeFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile___cinit__(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_10NativeFile___cinit__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/io.pxi":59
 * 
 *     def __cinit__(self):
 *         self.own_file = False             # <<<<<<<<<<<<<<
 *         self.is_readable = False
 *         self.is_writable = False
 */
  __pyx_v_self->own_file = 0;

  /* "pyarrow/io.pxi":60
 *     def __cinit__(self):
 *         self.own_file = False
 *         self.is_readable = False             # <<<<<<<<<<<<<<
 *         self.is_writable = False
 *         self.is_seekable = False
 */
  __pyx_v_self->is_readable = 0;

  /* "pyarrow/io.pxi":61
 *         self.own_file = False
 *         self.is_readable = False
 *         self.is_writable = False             # <<<<<<<<<<<<<<
 *         self.is_seekable = False
 * 
 */
  __pyx_v_self->is_writable = 0;

  /* "pyarrow/io.pxi":62
 *         self.is_readable = False
 *         self.is_writable = False
 *         self.is_seekable = False             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_v_self->is_seekable = 0;

  /* "pyarrow/io.pxi":58
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.own_file = False
 *         self.is_readable = False
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":64
 *         self.is_seekable = False
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.own_file:
 *             self.close()
 */

/* Python wrapper */
static void __pyx_pw_7pyarrow_3lib_10NativeFile_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7pyarrow_3lib_10NativeFile_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7pyarrow_3lib_10NativeFile_2__dealloc__(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_7pyarrow_3lib_10NativeFile_2__dealloc__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pyarrow/io.pxi":65
 * 
 *     def __dealloc__(self):
 *         if self.own_file:             # <<<<<<<<<<<<<<
 *             self.close()
 * 
 */
  __pyx_t_1 = (__pyx_v_self->own_file != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":66
 *     def __dealloc__(self):
 *         if self.own_file:
 *             self.close()             # <<<<<<<<<<<<<<
 * 
 *     def __enter__(self):
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 66, __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(6, 66, __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":65
 * 
 *     def __dealloc__(self):
 *         if self.own_file:             # <<<<<<<<<<<<<<
 *             self.close()
 * 
 */
  }

  /* "pyarrow/io.pxi":64
 *         self.is_seekable = False
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.own_file:
 *             self.close()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("pyarrow.lib.NativeFile.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/io.pxi":68
 *             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":69
 * 
 *     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":68
 *             self.close()
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":71
 *         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(6, 71, __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(6, 71, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(6, 71, __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(6, 71, __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":72
 * 
 *     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(6, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 72, __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":71
 *         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":75
 * 
 *     @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":84
 *         """
 *         # 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":85
 *         # Emulate built-in file modes
 *         if self.is_readable and self.is_writable:
 *             return 'rb+'             # <<<<<<<<<<<<<<
 *         elif self.is_readable:
 *             return 'rb'
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_kp_u_rb);
    __pyx_r = __pyx_kp_u_rb;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":84
 *         """
 *         # Emulate built-in file modes
 *         if self.is_readable and self.is_writable:             # <<<<<<<<<<<<<<
 *             return 'rb+'
 *         elif self.is_readable:
 */
  }

  /* "pyarrow/io.pxi":86
 *         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":87
 *             return 'rb+'
 *         elif self.is_readable:
 *             return 'rb'             # <<<<<<<<<<<<<<
 *         elif self.is_writable:
 *             return 'wb'
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_rb_2);
    __pyx_r = __pyx_n_u_rb_2;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":86
 *         if self.is_readable and self.is_writable:
 *             return 'rb+'
 *         elif self.is_readable:             # <<<<<<<<<<<<<<
 *             return 'rb'
 *         elif self.is_writable:
 */
  }

  /* "pyarrow/io.pxi":88
 *         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":89
 *             return 'rb'
 *         elif self.is_writable:
 *             return 'wb'             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError('File object is malformed, has no mode')
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_wb);
    __pyx_r = __pyx_n_u_wb;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":88
 *         elif self.is_readable:
 *             return 'rb'
 *         elif self.is_writable:             # <<<<<<<<<<<<<<
 *             return 'wb'
 *         else:
 */
  }

  /* "pyarrow/io.pxi":91
 *             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__144, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 91, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(6, 91, __pyx_L1_error)
  }

  /* "pyarrow/io.pxi":75
 * 
 *     @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":93
 *             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":94
 * 
 *     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(6, 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(6, 94, __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":95
 *     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(6, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":93
 *             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":97
 *         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":98
 * 
 *     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(6, 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(6, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":99
 *     def 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(6, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":97
 *         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":101
 *         return self.is_writable
 * 
 *     def seekable(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         return self.is_seekable
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_13seekable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_12seekable[] = "NativeFile.seekable(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_13seekable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("seekable (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_12seekable(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_12seekable(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("seekable", 0);

  /* "pyarrow/io.pxi":102
 * 
 *     def seekable(self):
 *         self._assert_open()             # <<<<<<<<<<<<<<
 *         return self.is_seekable
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":103
 *     def seekable(self):
 *         self._assert_open()
 *         return self.is_seekable             # <<<<<<<<<<<<<<
 * 
 *     def isatty(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->is_seekable); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":101
 *         return self.is_writable
 * 
 *     def seekable(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         return self.is_seekable
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.seekable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":105
 *         return self.is_seekable
 * 
 *     def isatty(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         return False
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_15isatty(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_14isatty[] = "NativeFile.isatty(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_15isatty(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isatty (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_14isatty(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_14isatty(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("isatty", 0);

  /* "pyarrow/io.pxi":106
 * 
 *     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(6, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":107
 *     def 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":105
 *         return self.is_seekable
 * 
 *     def isatty(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         return False
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.isatty", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":109
 *         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":113
 *         NOT IMPLEMENTED
 *         """
 *         raise UnsupportedOperation()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_UnsupportedOperation); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 113, __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(6, 113, __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(6, 113, __pyx_L1_error)

  /* "pyarrow/io.pxi":109
 *         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":116
 * 
 *     @property
 *     def closed(self):             # <<<<<<<<<<<<<<
 *         if self.is_readable:
 *             return self.input_stream.get().closed()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_6closed_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_6closed_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_6closed___get__(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_6closed___get__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/io.pxi":117
 *     @property
 *     def closed(self):
 *         if self.is_readable:             # <<<<<<<<<<<<<<
 *             return self.input_stream.get().closed()
 *         elif self.is_writable:
 */
  __pyx_t_1 = (__pyx_v_self->is_readable != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":118
 *     def closed(self):
 *         if self.is_readable:
 *             return self.input_stream.get().closed()             # <<<<<<<<<<<<<<
 *         elif self.is_writable:
 *             return self.output_stream.get().closed()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->input_stream.get()->closed()); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":117
 *     @property
 *     def closed(self):
 *         if self.is_readable:             # <<<<<<<<<<<<<<
 *             return self.input_stream.get().closed()
 *         elif self.is_writable:
 */
  }

  /* "pyarrow/io.pxi":119
 *         if self.is_readable:
 *             return self.input_stream.get().closed()
 *         elif self.is_writable:             # <<<<<<<<<<<<<<
 *             return self.output_stream.get().closed()
 *         else:
 */
  __pyx_t_1 = (__pyx_v_self->is_writable != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":120
 *             return self.input_stream.get().closed()
 *         elif self.is_writable:
 *             return self.output_stream.get().closed()             # <<<<<<<<<<<<<<
 *         else:
 *             return True
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->output_stream.get()->closed()); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 120, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":119
 *         if self.is_readable:
 *             return self.input_stream.get().closed()
 *         elif self.is_writable:             # <<<<<<<<<<<<<<
 *             return self.output_stream.get().closed()
 *         else:
 */
  }

  /* "pyarrow/io.pxi":122
 *             return self.output_stream.get().closed()
 *         else:
 *             return True             # <<<<<<<<<<<<<<
 * 
 *     def close(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;
  }

  /* "pyarrow/io.pxi":116
 * 
 *     @property
 *     def closed(self):             # <<<<<<<<<<<<<<
 *         if self.is_readable:
 *             return self.input_stream.get().closed()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.closed.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":124
 *             return True
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         if not self.closed:
 *             with nogil:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_19close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_18close[] = "NativeFile.close(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_19close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_18close(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_18close(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("close", 0);

  /* "pyarrow/io.pxi":125
 * 
 *     def close(self):
 *         if not self.closed:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 if self.is_readable:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_closed); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 125, __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(6, 125, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((!__pyx_t_2) != 0);
  if (__pyx_t_3) {

    /* "pyarrow/io.pxi":126
 *     def close(self):
 *         if not self.closed:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 if self.is_readable:
 *                     check_status(self.input_stream.get().Close())
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/io.pxi":127
 *         if not self.closed:
 *             with nogil:
 *                 if self.is_readable:             # <<<<<<<<<<<<<<
 *                     check_status(self.input_stream.get().Close())
 *                 else:
 */
          __pyx_t_3 = (__pyx_v_self->is_readable != 0);
          if (__pyx_t_3) {

            /* "pyarrow/io.pxi":128
 *             with nogil:
 *                 if self.is_readable:
 *                     check_status(self.input_stream.get().Close())             # <<<<<<<<<<<<<<
 *                 else:
 *                     check_status(self.output_stream.get().Close())
 */
            __pyx_t_4 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->input_stream.get()->Close()); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(6, 128, __pyx_L5_error)

            /* "pyarrow/io.pxi":127
 *         if not self.closed:
 *             with nogil:
 *                 if self.is_readable:             # <<<<<<<<<<<<<<
 *                     check_status(self.input_stream.get().Close())
 *                 else:
 */
            goto __pyx_L7;
          }

          /* "pyarrow/io.pxi":130
 *                     check_status(self.input_stream.get().Close())
 *                 else:
 *                     check_status(self.output_stream.get().Close())             # <<<<<<<<<<<<<<
 * 
 *     def flush(self):
 */
          /*else*/ {
            __pyx_t_4 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->output_stream.get()->Close()); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(6, 130, __pyx_L5_error)
          }
          __pyx_L7:;
        }

        /* "pyarrow/io.pxi":126
 *     def close(self):
 *         if not self.closed:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 if self.is_readable:
 *                     check_status(self.input_stream.get().Close())
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L6;
          }
          __pyx_L5_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L6:;
        }
    }

    /* "pyarrow/io.pxi":125
 * 
 *     def close(self):
 *         if not self.closed:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 if self.is_readable:
 */
  }

  /* "pyarrow/io.pxi":124
 *             return True
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         if not self.closed:
 *             with nogil:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":132
 *                     check_status(self.output_stream.get().Close())
 * 
 *     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":136
 * 
 *         No-op to match the IOBase interface."""
 *         self._assert_open()             # <<<<<<<<<<<<<<
 * 
 *     cdef set_random_access_file(self, shared_ptr[RandomAccessFile] handle):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 136, __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":132
 *                     check_status(self.output_stream.get().Close())
 * 
 *     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":138
 *         self._assert_open()
 * 
 *     cdef set_random_access_file(self, shared_ptr[RandomAccessFile] handle):             # <<<<<<<<<<<<<<
 *         self.input_stream = <shared_ptr[InputStream]> handle
 *         self.random_access = handle
 */

static PyObject *__pyx_f_7pyarrow_3lib_10NativeFile_set_random_access_file(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, std::shared_ptr<arrow::io::RandomAccessFile>  __pyx_v_handle) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_random_access_file", 0);

  /* "pyarrow/io.pxi":139
 * 
 *     cdef set_random_access_file(self, shared_ptr[RandomAccessFile] handle):
 *         self.input_stream = <shared_ptr[InputStream]> handle             # <<<<<<<<<<<<<<
 *         self.random_access = handle
 *         self.is_seekable = True
 */
  __pyx_v_self->input_stream = ((std::shared_ptr<arrow::io::InputStream> )__pyx_v_handle);

  /* "pyarrow/io.pxi":140
 *     cdef set_random_access_file(self, shared_ptr[RandomAccessFile] handle):
 *         self.input_stream = <shared_ptr[InputStream]> handle
 *         self.random_access = handle             # <<<<<<<<<<<<<<
 *         self.is_seekable = True
 * 
 */
  __pyx_v_self->random_access = __pyx_v_handle;

  /* "pyarrow/io.pxi":141
 *         self.input_stream = <shared_ptr[InputStream]> handle
 *         self.random_access = handle
 *         self.is_seekable = True             # <<<<<<<<<<<<<<
 * 
 *     cdef set_input_stream(self, shared_ptr[InputStream] handle):
 */
  __pyx_v_self->is_seekable = 1;

  /* "pyarrow/io.pxi":138
 *         self._assert_open()
 * 
 *     cdef set_random_access_file(self, shared_ptr[RandomAccessFile] handle):             # <<<<<<<<<<<<<<
 *         self.input_stream = <shared_ptr[InputStream]> handle
 *         self.random_access = handle
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":143
 *         self.is_seekable = True
 * 
 *     cdef set_input_stream(self, shared_ptr[InputStream] handle):             # <<<<<<<<<<<<<<
 *         self.input_stream = handle
 *         self.random_access.reset()
 */

static PyObject *__pyx_f_7pyarrow_3lib_10NativeFile_set_input_stream(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, std::shared_ptr<arrow::io::InputStream>  __pyx_v_handle) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_input_stream", 0);

  /* "pyarrow/io.pxi":144
 * 
 *     cdef set_input_stream(self, shared_ptr[InputStream] handle):
 *         self.input_stream = handle             # <<<<<<<<<<<<<<
 *         self.random_access.reset()
 *         self.is_seekable = False
 */
  __pyx_v_self->input_stream = __pyx_v_handle;

  /* "pyarrow/io.pxi":145
 *     cdef set_input_stream(self, shared_ptr[InputStream] handle):
 *         self.input_stream = handle
 *         self.random_access.reset()             # <<<<<<<<<<<<<<
 *         self.is_seekable = False
 * 
 */
  __pyx_v_self->random_access.reset();

  /* "pyarrow/io.pxi":146
 *         self.input_stream = handle
 *         self.random_access.reset()
 *         self.is_seekable = False             # <<<<<<<<<<<<<<
 * 
 *     cdef set_output_stream(self, shared_ptr[OutputStream] handle):
 */
  __pyx_v_self->is_seekable = 0;

  /* "pyarrow/io.pxi":143
 *         self.is_seekable = True
 * 
 *     cdef set_input_stream(self, shared_ptr[InputStream] handle):             # <<<<<<<<<<<<<<
 *         self.input_stream = handle
 *         self.random_access.reset()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":148
 *         self.is_seekable = False
 * 
 *     cdef set_output_stream(self, shared_ptr[OutputStream] handle):             # <<<<<<<<<<<<<<
 *         self.output_stream = handle
 * 
 */

static PyObject *__pyx_f_7pyarrow_3lib_10NativeFile_set_output_stream(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, std::shared_ptr<arrow::io::OutputStream>  __pyx_v_handle) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_output_stream", 0);

  /* "pyarrow/io.pxi":149
 * 
 *     cdef set_output_stream(self, shared_ptr[OutputStream] handle):
 *         self.output_stream = handle             # <<<<<<<<<<<<<<
 * 
 *     cdef shared_ptr[RandomAccessFile] get_random_access_file(self) except *:
 */
  __pyx_v_self->output_stream = __pyx_v_handle;

  /* "pyarrow/io.pxi":148
 *         self.is_seekable = False
 * 
 *     cdef set_output_stream(self, shared_ptr[OutputStream] handle):             # <<<<<<<<<<<<<<
 *         self.output_stream = handle
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":151
 *         self.output_stream = handle
 * 
 *     cdef shared_ptr[RandomAccessFile] get_random_access_file(self) except *:             # <<<<<<<<<<<<<<
 *         self._assert_readable()
 *         self._assert_seekable()
 */

static std::shared_ptr<arrow::io::RandomAccessFile>  __pyx_f_7pyarrow_3lib_10NativeFile_get_random_access_file(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  std::shared_ptr<arrow::io::RandomAccessFile>  __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("get_random_access_file", 0);

  /* "pyarrow/io.pxi":152
 * 
 *     cdef shared_ptr[RandomAccessFile] get_random_access_file(self) except *:
 *         self._assert_readable()             # <<<<<<<<<<<<<<
 *         self._assert_seekable()
 *         return self.random_access
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_readable); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 152, __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":153
 *     cdef shared_ptr[RandomAccessFile] get_random_access_file(self) except *:
 *         self._assert_readable()
 *         self._assert_seekable()             # <<<<<<<<<<<<<<
 *         return self.random_access
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_seekable); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 153, __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":154
 *         self._assert_readable()
 *         self._assert_seekable()
 *         return self.random_access             # <<<<<<<<<<<<<<
 * 
 *     cdef shared_ptr[InputStream] get_input_stream(self) except *:
 */
  __pyx_r = __pyx_v_self->random_access;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":151
 *         self.output_stream = handle
 * 
 *     cdef shared_ptr[RandomAccessFile] get_random_access_file(self) except *:             # <<<<<<<<<<<<<<
 *         self._assert_readable()
 *         self._assert_seekable()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.get_random_access_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":156
 *         return self.random_access
 * 
 *     cdef shared_ptr[InputStream] get_input_stream(self) except *:             # <<<<<<<<<<<<<<
 *         self._assert_readable()
 *         return self.input_stream
 */

static std::shared_ptr<arrow::io::InputStream>  __pyx_f_7pyarrow_3lib_10NativeFile_get_input_stream(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  std::shared_ptr<arrow::io::InputStream>  __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("get_input_stream", 0);

  /* "pyarrow/io.pxi":157
 * 
 *     cdef shared_ptr[InputStream] get_input_stream(self) except *:
 *         self._assert_readable()             # <<<<<<<<<<<<<<
 *         return self.input_stream
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_readable); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 157, __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":158
 *     cdef shared_ptr[InputStream] get_input_stream(self) except *:
 *         self._assert_readable()
 *         return self.input_stream             # <<<<<<<<<<<<<<
 * 
 *     cdef shared_ptr[OutputStream] get_output_stream(self) except *:
 */
  __pyx_r = __pyx_v_self->input_stream;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":156
 *         return self.random_access
 * 
 *     cdef shared_ptr[InputStream] get_input_stream(self) except *:             # <<<<<<<<<<<<<<
 *         self._assert_readable()
 *         return self.input_stream
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.get_input_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":160
 *         return self.input_stream
 * 
 *     cdef shared_ptr[OutputStream] get_output_stream(self) except *:             # <<<<<<<<<<<<<<
 *         self._assert_writable()
 *         return self.output_stream
 */

static std::shared_ptr<arrow::io::OutputStream>  __pyx_f_7pyarrow_3lib_10NativeFile_get_output_stream(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  std::shared_ptr<arrow::io::OutputStream>  __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("get_output_stream", 0);

  /* "pyarrow/io.pxi":161
 * 
 *     cdef shared_ptr[OutputStream] get_output_stream(self) except *:
 *         self._assert_writable()             # <<<<<<<<<<<<<<
 *         return self.output_stream
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_writable); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 161, __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":162
 *     cdef shared_ptr[OutputStream] get_output_stream(self) except *:
 *         self._assert_writable()
 *         return self.output_stream             # <<<<<<<<<<<<<<
 * 
 *     def _assert_open(self):
 */
  __pyx_r = __pyx_v_self->output_stream;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":160
 *         return self.input_stream
 * 
 *     cdef shared_ptr[OutputStream] get_output_stream(self) except *:             # <<<<<<<<<<<<<<
 *         self._assert_writable()
 *         return self.output_stream
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.get_output_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":164
 *         return self.output_stream
 * 
 *     def _assert_open(self):             # <<<<<<<<<<<<<<
 *         if self.closed:
 *             raise ValueError("I/O operation on closed file")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_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
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("_assert_open", 0);

  /* "pyarrow/io.pxi":165
 * 
 *     def _assert_open(self):
 *         if self.closed:             # <<<<<<<<<<<<<<
 *             raise ValueError("I/O operation on closed file")
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_closed); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 165, __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(6, 165, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/io.pxi":166
 *     def _assert_open(self):
 *         if self.closed:
 *             raise ValueError("I/O operation on closed file")             # <<<<<<<<<<<<<<
 * 
 *     def _assert_readable(self):
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__145, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 166, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 166, __pyx_L1_error)

    /* "pyarrow/io.pxi":165
 * 
 *     def _assert_open(self):
 *         if self.closed:             # <<<<<<<<<<<<<<
 *             raise ValueError("I/O operation on closed file")
 * 
 */
  }

  /* "pyarrow/io.pxi":164
 *         return self.output_stream
 * 
 *     def _assert_open(self):             # <<<<<<<<<<<<<<
 *         if self.closed:
 *             raise ValueError("I/O operation on closed file")
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile._assert_open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":168
 *             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":169
 * 
 *     def _assert_readable(self):
 *         self._assert_open()             # <<<<<<<<<<<<<<
 *         if not self.is_readable:
 *             # XXX UnsupportedOperation
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 169, __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":170
 *     def _assert_readable(self):
 *         self._assert_open()
 *         if not self.is_readable:             # <<<<<<<<<<<<<<
 *             # XXX UnsupportedOperation
 *             raise IOError("only valid on readonly files")
 */
  __pyx_t_4 = ((!(__pyx_v_self->is_readable != 0)) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "pyarrow/io.pxi":172
 *         if not self.is_readable:
 *             # XXX UnsupportedOperation
 *             raise IOError("only valid on readonly files")             # <<<<<<<<<<<<<<
 * 
 *     def _assert_writable(self):
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__146, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 172, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 172, __pyx_L1_error)

    /* "pyarrow/io.pxi":170
 *     def _assert_readable(self):
 *         self._assert_open()
 *         if not self.is_readable:             # <<<<<<<<<<<<<<
 *             # XXX UnsupportedOperation
 *             raise IOError("only valid on readonly files")
 */
  }

  /* "pyarrow/io.pxi":168
 *             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":174
 *             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":175
 * 
 *     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(6, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 175, __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":176
 *     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":177
 *         self._assert_open()
 *         if not self.is_writable:
 *             raise IOError("only valid on writable files")             # <<<<<<<<<<<<<<
 * 
 *     def _assert_seekable(self):
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__147, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 177, __pyx_L1_error)

    /* "pyarrow/io.pxi":176
 *     def _assert_writable(self):
 *         self._assert_open()
 *         if not self.is_writable:             # <<<<<<<<<<<<<<
 *             raise IOError("only valid on writable files")
 * 
 */
  }

  /* "pyarrow/io.pxi":174
 *             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":179
 *             raise IOError("only valid on writable files")
 * 
 *     def _assert_seekable(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         if not self.is_seekable:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_29_assert_seekable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_28_assert_seekable[] = "NativeFile._assert_seekable(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_29_assert_seekable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_assert_seekable (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_28_assert_seekable(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_28_assert_seekable(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("_assert_seekable", 0);

  /* "pyarrow/io.pxi":180
 * 
 *     def _assert_seekable(self):
 *         self._assert_open()             # <<<<<<<<<<<<<<
 *         if not self.is_seekable:
 *             raise IOError("only valid on seekable files")
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 180, __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":181
 *     def _assert_seekable(self):
 *         self._assert_open()
 *         if not self.is_seekable:             # <<<<<<<<<<<<<<
 *             raise IOError("only valid on seekable files")
 * 
 */
  __pyx_t_4 = ((!(__pyx_v_self->is_seekable != 0)) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "pyarrow/io.pxi":182
 *         self._assert_open()
 *         if not self.is_seekable:
 *             raise IOError("only valid on seekable files")             # <<<<<<<<<<<<<<
 * 
 *     def size(self):
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__148, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 182, __pyx_L1_error)

    /* "pyarrow/io.pxi":181
 *     def _assert_seekable(self):
 *         self._assert_open()
 *         if not self.is_seekable:             # <<<<<<<<<<<<<<
 *             raise IOError("only valid on seekable files")
 * 
 */
  }

  /* "pyarrow/io.pxi":179
 *             raise IOError("only valid on writable files")
 * 
 *     def _assert_seekable(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         if not self.is_seekable:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile._assert_seekable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":184
 *             raise IOError("only valid on seekable files")
 * 
 *     def size(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return file size
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_31size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_30size[] = "NativeFile.size(self)\n\n        Return file size\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_31size(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_30size(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_30size(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  int64_t __pyx_v_size;
  std::shared_ptr<arrow::io::RandomAccessFile>  __pyx_v_handle;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr<arrow::io::RandomAccessFile>  __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("size", 0);

  /* "pyarrow/io.pxi":190
 *         cdef int64_t size
 * 
 *         handle = self.get_random_access_file()             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(handle.get().GetSize(&size))
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_self->__pyx_vtab)->get_random_access_file(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 190, __pyx_L1_error)
  __pyx_v_handle = __pyx_t_1;

  /* "pyarrow/io.pxi":191
 * 
 *         handle = self.get_random_access_file()
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(handle.get().GetSize(&size))
 *         return size
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":192
 *         handle = self.get_random_access_file()
 *         with nogil:
 *             check_status(handle.get().GetSize(&size))             # <<<<<<<<<<<<<<
 *         return size
 * 
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_handle.get()->GetSize((&__pyx_v_size))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 192, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":191
 * 
 *         handle = self.get_random_access_file()
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(handle.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":193
 *         with nogil:
 *             check_status(handle.get().GetSize(&size))
 *         return size             # <<<<<<<<<<<<<<
 * 
 *     def tell(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":184
 *             raise IOError("only valid on seekable files")
 * 
 *     def size(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return file size
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":195
 *         return size
 * 
 *     def tell(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return current stream position
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_33tell(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_32tell[] = "NativeFile.tell(self)\n\n        Return current stream position\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_33tell(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_32tell(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_32tell(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  int64_t __pyx_v_position;
  std::shared_ptr<arrow::io::RandomAccessFile>  __pyx_v_rd_handle;
  std::shared_ptr<arrow::io::OutputStream>  __pyx_v_wr_handle;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  std::shared_ptr<arrow::io::RandomAccessFile>  __pyx_t_2;
  int __pyx_t_3;
  std::shared_ptr<arrow::io::OutputStream>  __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("tell", 0);

  /* "pyarrow/io.pxi":201
 *         cdef int64_t position
 * 
 *         if self.is_readable:             # <<<<<<<<<<<<<<
 *             rd_handle = self.get_random_access_file()
 *             with nogil:
 */
  __pyx_t_1 = (__pyx_v_self->is_readable != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":202
 * 
 *         if self.is_readable:
 *             rd_handle = self.get_random_access_file()             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(rd_handle.get().Tell(&position))
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_self->__pyx_vtab)->get_random_access_file(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 202, __pyx_L1_error)
    __pyx_v_rd_handle = __pyx_t_2;

    /* "pyarrow/io.pxi":203
 *         if self.is_readable:
 *             rd_handle = self.get_random_access_file()
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(rd_handle.get().Tell(&position))
 *         else:
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/io.pxi":204
 *             rd_handle = self.get_random_access_file()
 *             with nogil:
 *                 check_status(rd_handle.get().Tell(&position))             # <<<<<<<<<<<<<<
 *         else:
 *             wr_handle = self.get_output_stream()
 */
          __pyx_t_3 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_rd_handle.get()->Tell((&__pyx_v_position))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(6, 204, __pyx_L5_error)
        }

        /* "pyarrow/io.pxi":203
 *         if self.is_readable:
 *             rd_handle = self.get_random_access_file()
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(rd_handle.get().Tell(&position))
 *         else:
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L6;
          }
          __pyx_L5_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L6:;
        }
    }

    /* "pyarrow/io.pxi":201
 *         cdef int64_t position
 * 
 *         if self.is_readable:             # <<<<<<<<<<<<<<
 *             rd_handle = self.get_random_access_file()
 *             with nogil:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/io.pxi":206
 *                 check_status(rd_handle.get().Tell(&position))
 *         else:
 *             wr_handle = self.get_output_stream()             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(wr_handle.get().Tell(&position))
 */
  /*else*/ {
    __pyx_t_4 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_self->__pyx_vtab)->get_output_stream(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 206, __pyx_L1_error)
    __pyx_v_wr_handle = __pyx_t_4;

    /* "pyarrow/io.pxi":207
 *         else:
 *             wr_handle = self.get_output_stream()
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(wr_handle.get().Tell(&position))
 *         return position
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/io.pxi":208
 *             wr_handle = self.get_output_stream()
 *             with nogil:
 *                 check_status(wr_handle.get().Tell(&position))             # <<<<<<<<<<<<<<
 *         return position
 * 
 */
          __pyx_t_3 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_wr_handle.get()->Tell((&__pyx_v_position))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(6, 208, __pyx_L8_error)
        }

        /* "pyarrow/io.pxi":207
 *         else:
 *             wr_handle = self.get_output_stream()
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(wr_handle.get().Tell(&position))
 *         return position
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L9;
          }
          __pyx_L8_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L9:;
        }
    }
  }
  __pyx_L3:;

  /* "pyarrow/io.pxi":209
 *             with nogil:
 *                 check_status(wr_handle.get().Tell(&position))
 *         return position             # <<<<<<<<<<<<<<
 * 
 *     def seek(self, int64_t position, int whence=0):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_position); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":195
 *         return size
 * 
 *     def tell(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return current stream position
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.tell", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":211
 *         return position
 * 
 *     def seek(self, int64_t position, int whence=0):             # <<<<<<<<<<<<<<
 *         """
 *         Change current file stream position
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_35seek(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_34seek[] = "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_35seek(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(6, 211, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_position = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_position == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 211, __pyx_L3_error)
    if (values[1]) {
      __pyx_v_whence = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_whence == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 211, __pyx_L3_error)
    } else {
      __pyx_v_whence = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("seek", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 211, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.seek", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_34seek(((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_34seek(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, int64_t __pyx_v_position, int __pyx_v_whence) {
  int64_t __pyx_v_offset;
  std::shared_ptr<arrow::io::RandomAccessFile>  __pyx_v_handle;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr<arrow::io::RandomAccessFile>  __pyx_t_1;
  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("seek", 0);

  /* "pyarrow/io.pxi":234
 *         """
 *         cdef int64_t offset
 *         handle = self.get_random_access_file()             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_self->__pyx_vtab)->get_random_access_file(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 234, __pyx_L1_error)
  __pyx_v_handle = __pyx_t_1;

  /* "pyarrow/io.pxi":236
 *         handle = self.get_random_access_file()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             if whence == 0:
 *                 offset = position
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":237
 * 
 *         with nogil:
 *             if whence == 0:             # <<<<<<<<<<<<<<
 *                 offset = position
 *             elif whence == 1:
 */
        switch (__pyx_v_whence) {
          case 0:

          /* "pyarrow/io.pxi":238
 *         with nogil:
 *             if whence == 0:
 *                 offset = position             # <<<<<<<<<<<<<<
 *             elif whence == 1:
 *                 check_status(handle.get().Tell(&offset))
 */
          __pyx_v_offset = __pyx_v_position;

          /* "pyarrow/io.pxi":237
 * 
 *         with nogil:
 *             if whence == 0:             # <<<<<<<<<<<<<<
 *                 offset = position
 *             elif whence == 1:
 */
          break;
          case 1:

          /* "pyarrow/io.pxi":240
 *                 offset = position
 *             elif whence == 1:
 *                 check_status(handle.get().Tell(&offset))             # <<<<<<<<<<<<<<
 *                 offset = offset + position
 *             elif whence == 2:
 */
          __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_handle.get()->Tell((&__pyx_v_offset))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 240, __pyx_L4_error)

          /* "pyarrow/io.pxi":241
 *             elif whence == 1:
 *                 check_status(handle.get().Tell(&offset))
 *                 offset = offset + position             # <<<<<<<<<<<<<<
 *             elif whence == 2:
 *                 check_status(handle.get().GetSize(&offset))
 */
          __pyx_v_offset = (__pyx_v_offset + __pyx_v_position);

          /* "pyarrow/io.pxi":239
 *             if whence == 0:
 *                 offset = position
 *             elif whence == 1:             # <<<<<<<<<<<<<<
 *                 check_status(handle.get().Tell(&offset))
 *                 offset = offset + position
 */
          break;
          case 2:

          /* "pyarrow/io.pxi":243
 *                 offset = offset + position
 *             elif whence == 2:
 *                 check_status(handle.get().GetSize(&offset))             # <<<<<<<<<<<<<<
 *                 offset = offset + position
 *             else:
 */
          __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_handle.get()->GetSize((&__pyx_v_offset))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 243, __pyx_L4_error)

          /* "pyarrow/io.pxi":244
 *             elif whence == 2:
 *                 check_status(handle.get().GetSize(&offset))
 *                 offset = offset + position             # <<<<<<<<<<<<<<
 *             else:
 *                 with gil:
 */
          __pyx_v_offset = (__pyx_v_offset + __pyx_v_position);

          /* "pyarrow/io.pxi":242
 *                 check_status(handle.get().Tell(&offset))
 *                 offset = offset + position
 *             elif whence == 2:             # <<<<<<<<<<<<<<
 *                 check_status(handle.get().GetSize(&offset))
 *                 offset = offset + position
 */
          break;
          default:

          /* "pyarrow/io.pxi":246
 *                 offset = offset + position
 *             else:
 *                 with gil:             # <<<<<<<<<<<<<<
 *                     raise ValueError("Invalid value of whence: {0}"
 *                                      .format(whence))
 */
          {
              #ifdef WITH_THREAD
              PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
              #endif
              /*try:*/ {

                /* "pyarrow/io.pxi":248
 *                 with gil:
 *                     raise ValueError("Invalid value of whence: {0}"
 *                                      .format(whence))             # <<<<<<<<<<<<<<
 *             check_status(handle.get().Seek(offset))
 * 
 */
                __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Invalid_value_of_whence_0, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 248, __pyx_L7_error)
                __Pyx_GOTREF(__pyx_t_4);
                __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_whence); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 248, __pyx_L7_error)
                __Pyx_GOTREF(__pyx_t_5);
                __pyx_t_6 = NULL;
                if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
                  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
                  if (likely(__pyx_t_6)) {
                    PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
                    __Pyx_INCREF(__pyx_t_6);
                    __Pyx_INCREF(function);
                    __Pyx_DECREF_SET(__pyx_t_4, function);
                  }
                }
                __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
                __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 248, __pyx_L7_error)
                __Pyx_GOTREF(__pyx_t_3);
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

                /* "pyarrow/io.pxi":247
 *             else:
 *                 with gil:
 *                     raise ValueError("Invalid value of whence: {0}"             # <<<<<<<<<<<<<<
 *                                      .format(whence))
 *             check_status(handle.get().Seek(offset))
 */
                __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 247, __pyx_L7_error)
                __Pyx_GOTREF(__pyx_t_4);
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                __Pyx_Raise(__pyx_t_4, 0, 0, 0);
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                __PYX_ERR(6, 247, __pyx_L7_error)
              }

              /* "pyarrow/io.pxi":246
 *                 offset = offset + position
 *             else:
 *                 with gil:             # <<<<<<<<<<<<<<
 *                     raise ValueError("Invalid value of whence: {0}"
 *                                      .format(whence))
 */
              /*finally:*/ {
                __pyx_L7_error: {
                  #ifdef WITH_THREAD
                  __Pyx_PyGILState_Release(__pyx_gilstate_save);
                  #endif
                  goto __pyx_L4_error;
                }
              }
          }
          break;
        }

        /* "pyarrow/io.pxi":249
 *                     raise ValueError("Invalid value of whence: {0}"
 *                                      .format(whence))
 *             check_status(handle.get().Seek(offset))             # <<<<<<<<<<<<<<
 * 
 *         return self.tell()
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_handle.get()->Seek(__pyx_v_offset)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 249, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":236
 *         handle = self.get_random_access_file()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             if whence == 0:
 *                 offset = position
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io.pxi":251
 *             check_status(handle.get().Seek(offset))
 * 
 *         return self.tell()             # <<<<<<<<<<<<<<
 * 
 *     def write(self, data):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tell); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":211
 *         return position
 * 
 *     def seek(self, int64_t position, int whence=0):             # <<<<<<<<<<<<<<
 *         """
 *         Change current file stream position
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.seek", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":253
 *         return self.tell()
 * 
 *     def write(self, data):             # <<<<<<<<<<<<<<
 *         """
 *         Write byte from any object implementing buffer protocol (bytes,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_37write(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_36write[] = "NativeFile.write(self, data)\n\n        Write byte from any object implementing buffer protocol (bytes,\n        bytearray, ndarray, pyarrow.Buffer)\n\n        Parameters\n        ----------\n        data : bytes-like object or exporter of buffer protocol\n\n        Returns\n        -------\n        nbytes : number of bytes written\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_37write(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_36write(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), ((PyObject *)__pyx_v_data));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_36write(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_data) {
  struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_arrow_buffer = 0;
  uint8_t const *__pyx_v_buf;
  int64_t __pyx_v_bufsize;
  std::shared_ptr<arrow::io::OutputStream>  __pyx_v_handle;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  std::shared_ptr<arrow::io::OutputStream>  __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("write", 0);

  /* "pyarrow/io.pxi":266
 *         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(6, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 266, __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":268
 *         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(6, 268, __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(6, 268, __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(6, 268, __pyx_L1_error)
  __pyx_v_arrow_buffer = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":270
 *         cdef Buffer arrow_buffer = py_buffer(data)
 * 
 *         cdef const uint8_t* buf = arrow_buffer.buffer.get().data()             # <<<<<<<<<<<<<<
 *         cdef int64_t bufsize = len(arrow_buffer)
 *         handle = self.get_output_stream()
 */
  __pyx_v_buf = __pyx_v_arrow_buffer->buffer.get()->data();

  /* "pyarrow/io.pxi":271
 * 
 *         cdef const uint8_t* buf = arrow_buffer.buffer.get().data()
 *         cdef int64_t bufsize = len(arrow_buffer)             # <<<<<<<<<<<<<<
 *         handle = self.get_output_stream()
 * 
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_arrow_buffer)); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(6, 271, __pyx_L1_error)
  __pyx_v_bufsize = __pyx_t_4;

  /* "pyarrow/io.pxi":272
 *         cdef const uint8_t* buf = arrow_buffer.buffer.get().data()
 *         cdef int64_t bufsize = len(arrow_buffer)
 *         handle = self.get_output_stream()             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_self->__pyx_vtab)->get_output_stream(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 272, __pyx_L1_error)
  __pyx_v_handle = __pyx_t_5;

  /* "pyarrow/io.pxi":274
 *         handle = self.get_output_stream()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(handle.get().Write(buf, bufsize))
 *         return bufsize
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":275
 * 
 *         with nogil:
 *             check_status(handle.get().Write(buf, bufsize))             # <<<<<<<<<<<<<<
 *         return bufsize
 * 
 */
        __pyx_t_6 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_handle.get()->Write(__pyx_v_buf, __pyx_v_bufsize)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(6, 275, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":274
 *         handle = self.get_output_stream()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(handle.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":276
 *         with nogil:
 *             check_status(handle.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(6, 276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":253
 *         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":278
 *         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_39read(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_38read[] = "NativeFile.read(self, nbytes=None)\n\n        Read indicated number of bytes from file, or read all remaining bytes\n        if no argument passed\n\n        Parameters\n        ----------\n        nbytes : int, default None\n\n        Returns\n        -------\n        data : bytes\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_39read(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_nbytes = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nbytes,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nbytes);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read") < 0)) __PYX_ERR(6, 278, __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(6, 278, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.read", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_38read(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), __pyx_v_nbytes);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_38read(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_nbytes) {
  int64_t __pyx_v_c_nbytes;
  int64_t __pyx_v_bytes_read;
  PyObject *__pyx_v_obj;
  long __pyx_v_bs;
  PyObject *__pyx_v_chunks = NULL;
  PyObject *__pyx_v_chunk = NULL;
  std::shared_ptr<arrow::io::InputStream>  __pyx_v_handle;
  uint8_t *__pyx_v_buf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int64_t __pyx_t_8;
  std::shared_ptr<arrow::io::InputStream>  __pyx_t_9;
  PyObject *__pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("read", 0);

  /* "pyarrow/io.pxi":293
 *         cdef:
 *             int64_t c_nbytes
 *             int64_t bytes_read = 0             # <<<<<<<<<<<<<<
 *             PyObject* obj
 * 
 */
  __pyx_v_bytes_read = 0;

  /* "pyarrow/io.pxi":296
 *             PyObject* obj
 * 
 *         if nbytes is None:             # <<<<<<<<<<<<<<
 *             if not self.is_seekable:
 *                 # Cannot get file size => read chunkwise
 */
  __pyx_t_1 = (__pyx_v_nbytes == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/io.pxi":297
 * 
 *         if nbytes is None:
 *             if not self.is_seekable:             # <<<<<<<<<<<<<<
 *                 # Cannot get file size => read chunkwise
 *                 bs = 16384
 */
    __pyx_t_2 = ((!(__pyx_v_self->is_seekable != 0)) != 0);
    if (__pyx_t_2) {

      /* "pyarrow/io.pxi":299
 *             if not self.is_seekable:
 *                 # Cannot get file size => read chunkwise
 *                 bs = 16384             # <<<<<<<<<<<<<<
 *                 chunks = []
 *                 while True:
 */
      __pyx_v_bs = 0x4000;

      /* "pyarrow/io.pxi":300
 *                 # Cannot get file size => read chunkwise
 *                 bs = 16384
 *                 chunks = []             # <<<<<<<<<<<<<<
 *                 while True:
 *                     chunk = self.read(bs)
 */
      __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 300, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_v_chunks = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "pyarrow/io.pxi":301
 *                 bs = 16384
 *                 chunks = []
 *                 while True:             # <<<<<<<<<<<<<<
 *                     chunk = self.read(bs)
 *                     if not chunk:
 */
      while (1) {

        /* "pyarrow/io.pxi":302
 *                 chunks = []
 *                 while True:
 *                     chunk = self.read(bs)             # <<<<<<<<<<<<<<
 *                     if not chunk:
 *                         break
 */
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 302, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_v_bs); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 302, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 302, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF_SET(__pyx_v_chunk, __pyx_t_3);
        __pyx_t_3 = 0;

        /* "pyarrow/io.pxi":303
 *                 while True:
 *                     chunk = self.read(bs)
 *                     if not chunk:             # <<<<<<<<<<<<<<
 *                         break
 *                     chunks.append(chunk)
 */
        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_chunk); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 303, __pyx_L1_error)
        __pyx_t_1 = ((!__pyx_t_2) != 0);
        if (__pyx_t_1) {

          /* "pyarrow/io.pxi":304
 *                     chunk = self.read(bs)
 *                     if not chunk:
 *                         break             # <<<<<<<<<<<<<<
 *                     chunks.append(chunk)
 *                 return b"".join(chunks)
 */
          goto __pyx_L6_break;

          /* "pyarrow/io.pxi":303
 *                 while True:
 *                     chunk = self.read(bs)
 *                     if not chunk:             # <<<<<<<<<<<<<<
 *                         break
 *                     chunks.append(chunk)
 */
        }

        /* "pyarrow/io.pxi":305
 *                     if not chunk:
 *                         break
 *                     chunks.append(chunk)             # <<<<<<<<<<<<<<
 *                 return b"".join(chunks)
 * 
 */
        __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_chunks, __pyx_v_chunk); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(6, 305, __pyx_L1_error)
      }
      __pyx_L6_break:;

      /* "pyarrow/io.pxi":306
 *                         break
 *                     chunks.append(chunk)
 *                 return b"".join(chunks)             # <<<<<<<<<<<<<<
 * 
 *             c_nbytes = self.size() - self.tell()
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyBytes_Join(__pyx_kp_b__149, __pyx_v_chunks); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 306, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "pyarrow/io.pxi":297
 * 
 *         if nbytes is None:
 *             if not self.is_seekable:             # <<<<<<<<<<<<<<
 *                 # Cannot get file size => read chunkwise
 *                 bs = 16384
 */
    }

    /* "pyarrow/io.pxi":308
 *                 return b"".join(chunks)
 * 
 *             c_nbytes = self.size() - self.tell()             # <<<<<<<<<<<<<<
 *         else:
 *             c_nbytes = nbytes
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 308, __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(6, 308, __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(6, 308, __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(6, 308, __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(6, 308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_t_5); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 308, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_c_nbytes = __pyx_t_8;

    /* "pyarrow/io.pxi":296
 *             PyObject* obj
 * 
 *         if nbytes is None:             # <<<<<<<<<<<<<<
 *             if not self.is_seekable:
 *                 # Cannot get file size => read chunkwise
 */
    goto __pyx_L3;
  }

  /* "pyarrow/io.pxi":310
 *             c_nbytes = self.size() - self.tell()
 *         else:
 *             c_nbytes = nbytes             # <<<<<<<<<<<<<<
 * 
 *         handle = self.get_input_stream()
 */
  /*else*/ {
    __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_v_nbytes); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 310, __pyx_L1_error)
    __pyx_v_c_nbytes = __pyx_t_8;
  }
  __pyx_L3:;

  /* "pyarrow/io.pxi":312
 *             c_nbytes = nbytes
 * 
 *         handle = self.get_input_stream()             # <<<<<<<<<<<<<<
 * 
 *         # Allocate empty write space
 */
  __pyx_t_9 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_self->__pyx_vtab)->get_input_stream(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 312, __pyx_L1_error)
  __pyx_v_handle = __pyx_t_9;

  /* "pyarrow/io.pxi":315
 * 
 *         # Allocate empty write space
 *         obj = PyBytes_FromStringAndSizeNative(NULL, c_nbytes)             # <<<<<<<<<<<<<<
 * 
 *         cdef uint8_t* buf = <uint8_t*> cp.PyBytes_AS_STRING(<object> obj)
 */
  __pyx_t_10 =  PyBytes_FromStringAndSize(NULL, __pyx_v_c_nbytes); if (unlikely(__pyx_t_10 == ((PyObject *)NULL))) __PYX_ERR(6, 315, __pyx_L1_error)
  __pyx_v_obj = __pyx_t_10;

  /* "pyarrow/io.pxi":317
 *         obj = PyBytes_FromStringAndSizeNative(NULL, c_nbytes)
 * 
 *         cdef uint8_t* buf = <uint8_t*> cp.PyBytes_AS_STRING(<object> obj)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(handle.get().Read(c_nbytes, &bytes_read, buf))
 */
  __pyx_v_buf = ((uint8_t *)PyBytes_AS_STRING(((PyObject *)__pyx_v_obj)));

  /* "pyarrow/io.pxi":318
 * 
 *         cdef uint8_t* buf = <uint8_t*> cp.PyBytes_AS_STRING(<object> obj)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(handle.get().Read(c_nbytes, &bytes_read, buf))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":319
 *         cdef uint8_t* buf = <uint8_t*> cp.PyBytes_AS_STRING(<object> obj)
 *         with nogil:
 *             check_status(handle.get().Read(c_nbytes, &bytes_read, buf))             # <<<<<<<<<<<<<<
 * 
 *         if bytes_read < c_nbytes:
 */
        __pyx_t_11 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_handle.get()->Read(__pyx_v_c_nbytes, (&__pyx_v_bytes_read), __pyx_v_buf)); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(6, 319, __pyx_L9_error)
      }

      /* "pyarrow/io.pxi":318
 * 
 *         cdef uint8_t* buf = <uint8_t*> cp.PyBytes_AS_STRING(<object> obj)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(handle.get().Read(c_nbytes, &bytes_read, buf))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L10;
        }
        __pyx_L9_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L10:;
      }
  }

  /* "pyarrow/io.pxi":321
 *             check_status(handle.get().Read(c_nbytes, &bytes_read, buf))
 * 
 *         if bytes_read < c_nbytes:             # <<<<<<<<<<<<<<
 *             cp._PyBytes_Resize(&obj, <Py_ssize_t> bytes_read)
 * 
 */
  __pyx_t_1 = ((__pyx_v_bytes_read < __pyx_v_c_nbytes) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":322
 * 
 *         if bytes_read < c_nbytes:
 *             cp._PyBytes_Resize(&obj, <Py_ssize_t> bytes_read)             # <<<<<<<<<<<<<<
 * 
 *         return PyObject_to_object(obj)
 */
    __pyx_t_11 = _PyBytes_Resize((&__pyx_v_obj), ((Py_ssize_t)__pyx_v_bytes_read)); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(6, 322, __pyx_L1_error)

    /* "pyarrow/io.pxi":321
 *             check_status(handle.get().Read(c_nbytes, &bytes_read, buf))
 * 
 *         if bytes_read < c_nbytes:             # <<<<<<<<<<<<<<
 *             cp._PyBytes_Resize(&obj, <Py_ssize_t> bytes_read)
 * 
 */
  }

  /* "pyarrow/io.pxi":324
 *             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(6, 324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":278
 *         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_XDECREF(__pyx_v_chunks);
  __Pyx_XDECREF(__pyx_v_chunk);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":326
 *         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_41read1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_40read1[] = "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_41read1(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(6, 326, __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(6, 326, __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_40read1(((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_40read1(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":330
 * 
 *         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(6, 330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_nbytes, Py_None) < 0) __PYX_ERR(6, 330, __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(6, 330, __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":326
 *         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":332
 *         return self.read(nbytes=None)
 * 
 *     def readall(self):             # <<<<<<<<<<<<<<
 *         return self.read()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_43readall(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_42readall[] = "NativeFile.readall(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_43readall(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_42readall(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_42readall(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":333
 * 
 *     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(6, 333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 333, __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":332
 *         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":335
 *         return self.read()
 * 
 *     def readinto(self, b):             # <<<<<<<<<<<<<<
 *         """
 *         Read into the supplied buffer
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_45readinto(PyObject *__pyx_v_self, PyObject *__pyx_v_b); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_44readinto[] = "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_45readinto(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_44readinto(((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_44readinto(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_b) {
  int64_t __pyx_v_bytes_read;
  uint8_t *__pyx_v_buf;
  struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_py_buf = 0;
  int64_t __pyx_v_buf_len;
  std::shared_ptr<arrow::io::InputStream>  __pyx_v_handle;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr<arrow::io::InputStream>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int64_t __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("readinto", 0);

  /* "pyarrow/io.pxi":354
 *             int64_t buf_len
 * 
 *         handle = self.get_input_stream()             # <<<<<<<<<<<<<<
 * 
 *         py_buf = py_buffer(b)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_self->__pyx_vtab)->get_input_stream(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 354, __pyx_L1_error)
  __pyx_v_handle = __pyx_t_1;

  /* "pyarrow/io.pxi":356
 *         handle = self.get_input_stream()
 * 
 *         py_buf = py_buffer(b)             # <<<<<<<<<<<<<<
 *         buf_len = py_buf.size
 *         buf = py_buf.buffer.get().mutable_data()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_py_buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_b) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_b);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7pyarrow_3lib_Buffer))))) __PYX_ERR(6, 356, __pyx_L1_error)
  __pyx_v_py_buf = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/io.pxi":357
 * 
 *         py_buf = py_buffer(b)
 *         buf_len = py_buf.size             # <<<<<<<<<<<<<<
 *         buf = py_buf.buffer.get().mutable_data()
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_py_buf), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 357, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_buf_len = __pyx_t_5;

  /* "pyarrow/io.pxi":358
 *         py_buf = py_buffer(b)
 *         buf_len = py_buf.size
 *         buf = py_buf.buffer.get().mutable_data()             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_v_buf = __pyx_v_py_buf->buffer.get()->mutable_data();

  /* "pyarrow/io.pxi":360
 *         buf = py_buf.buffer.get().mutable_data()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(handle.get().Read(buf_len, &bytes_read, buf))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":361
 * 
 *         with nogil:
 *             check_status(handle.get().Read(buf_len, &bytes_read, buf))             # <<<<<<<<<<<<<<
 * 
 *         return bytes_read
 */
        __pyx_t_6 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_handle.get()->Read(__pyx_v_buf_len, (&__pyx_v_bytes_read), __pyx_v_buf)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(6, 361, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":360
 *         buf = py_buf.buffer.get().mutable_data()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(handle.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":363
 *             check_status(handle.get().Read(buf_len, &bytes_read, buf))
 * 
 *         return bytes_read             # <<<<<<<<<<<<<<
 * 
 *     def readline(self, size=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_bytes_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":335
 *         return self.read()
 * 
 *     def readinto(self, b):             # <<<<<<<<<<<<<<
 *         """
 *         Read into the supplied buffer
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.readinto", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_py_buf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":365
 *         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_47readline(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_46readline[] = "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_47readline(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(6, 365, __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(6, 365, __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_46readline(((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_46readline(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":373
 *         """
 * 
 *         raise UnsupportedOperation()             # <<<<<<<<<<<<<<
 * 
 *     def readlines(self, hint=None):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_UnsupportedOperation); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 373, __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(6, 373, __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(6, 373, __pyx_L1_error)

  /* "pyarrow/io.pxi":365
 *         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":375
 *         raise UnsupportedOperation()
 * 
 *     def readlines(self, hint=None):             # <<<<<<<<<<<<<<
 *         """NOT IMPLEMENTED. Read lines of the file
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_49readlines(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_48readlines[] = "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_49readlines(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(6, 375, __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(6, 375, __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_48readlines(((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_48readlines(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":384
 *         """
 * 
 *         raise UnsupportedOperation()             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_UnsupportedOperation); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 384, __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(6, 384, __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(6, 384, __pyx_L1_error)

  /* "pyarrow/io.pxi":375
 *         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":386
 *         raise UnsupportedOperation()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         self._assert_readable()
 *         return self
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_51__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_51__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_50__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_50__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":387
 * 
 *     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(6, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 387, __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":388
 *     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":386
 *         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":390
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         line = self.readline()
 *         if not line:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_53__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_53__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_52__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_52__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":391
 * 
 *     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(6, 391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 391, __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":392
 *     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(6, 392, __pyx_L1_error)
  __pyx_t_5 = ((!__pyx_t_4) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "pyarrow/io.pxi":393
 *         line = self.readline()
 *         if not line:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 *         return line
 * 
 */
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
    __PYX_ERR(6, 393, __pyx_L1_error)

    /* "pyarrow/io.pxi":392
 *     def __next__(self):
 *         line = self.readline()
 *         if not line:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         return line
 */
  }

  /* "pyarrow/io.pxi":394
 *         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":390
 *         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":396
 *         return line
 * 
 *     def read_buffer(self, nbytes=None):             # <<<<<<<<<<<<<<
 *         cdef:
 *             int64_t c_nbytes
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_55read_buffer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_54read_buffer[] = "NativeFile.read_buffer(self, nbytes=None)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_55read_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(6, 396, __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(6, 396, __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_54read_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_54read_buffer(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_nbytes) {
  int64_t __pyx_v_c_nbytes;
  CYTHON_UNUSED int64_t __pyx_v_bytes_read;
  std::shared_ptr< arrow::Buffer>  __pyx_v_output;
  std::shared_ptr<arrow::io::InputStream>  __pyx_v_handle;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr<arrow::io::InputStream>  __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int64_t __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("read_buffer", 0);

  /* "pyarrow/io.pxi":399
 *         cdef:
 *             int64_t c_nbytes
 *             int64_t bytes_read = 0             # <<<<<<<<<<<<<<
 *             shared_ptr[CBuffer] output
 * 
 */
  __pyx_v_bytes_read = 0;

  /* "pyarrow/io.pxi":402
 *             shared_ptr[CBuffer] output
 * 
 *         handle = self.get_input_stream()             # <<<<<<<<<<<<<<
 * 
 *         if nbytes is None:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_self->__pyx_vtab)->get_input_stream(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 402, __pyx_L1_error)
  __pyx_v_handle = __pyx_t_1;

  /* "pyarrow/io.pxi":404
 *         handle = self.get_input_stream()
 * 
 *         if nbytes is None:             # <<<<<<<<<<<<<<
 *             if not self.is_seekable:
 *                 # Cannot get file size => read chunkwise
 */
  __pyx_t_2 = (__pyx_v_nbytes == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/io.pxi":405
 * 
 *         if nbytes is None:
 *             if not self.is_seekable:             # <<<<<<<<<<<<<<
 *                 # Cannot get file size => read chunkwise
 *                 return py_buffer(self.read())
 */
    __pyx_t_3 = ((!(__pyx_v_self->is_seekable != 0)) != 0);
    if (__pyx_t_3) {

      /* "pyarrow/io.pxi":407
 *             if not self.is_seekable:
 *                 # Cannot get file size => read chunkwise
 *                 return py_buffer(self.read())             # <<<<<<<<<<<<<<
 *             c_nbytes = self.size() - self.tell()
 *         else:
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_py_buffer); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 407, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 407, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 407, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 407, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;

      /* "pyarrow/io.pxi":405
 * 
 *         if nbytes is None:
 *             if not self.is_seekable:             # <<<<<<<<<<<<<<
 *                 # Cannot get file size => read chunkwise
 *                 return py_buffer(self.read())
 */
    }

    /* "pyarrow/io.pxi":408
 *                 # Cannot get file size => read chunkwise
 *                 return py_buffer(self.read())
 *             c_nbytes = self.size() - self.tell()             # <<<<<<<<<<<<<<
 *         else:
 *             c_nbytes = nbytes
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 408, __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(6, 408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tell); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 408, __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(6, 408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_9 = __Pyx_PyInt_As_int64_t(__pyx_t_6); if (unlikely((__pyx_t_9 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 408, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_c_nbytes = __pyx_t_9;

    /* "pyarrow/io.pxi":404
 *         handle = self.get_input_stream()
 * 
 *         if nbytes is None:             # <<<<<<<<<<<<<<
 *             if not self.is_seekable:
 *                 # Cannot get file size => read chunkwise
 */
    goto __pyx_L3;
  }

  /* "pyarrow/io.pxi":410
 *             c_nbytes = self.size() - self.tell()
 *         else:
 *             c_nbytes = nbytes             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  /*else*/ {
    __pyx_t_9 = __Pyx_PyInt_As_int64_t(__pyx_v_nbytes); if (unlikely((__pyx_t_9 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 410, __pyx_L1_error)
    __pyx_v_c_nbytes = __pyx_t_9;
  }
  __pyx_L3:;

  /* "pyarrow/io.pxi":412
 *             c_nbytes = nbytes
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(handle.get().ReadB(c_nbytes, &output))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":413
 * 
 *         with nogil:
 *             check_status(handle.get().ReadB(c_nbytes, &output))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_buffer(output)
 */
        __pyx_t_10 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_handle.get()-> Read(__pyx_v_c_nbytes, (&__pyx_v_output))); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(6, 413, __pyx_L6_error)
      }

      /* "pyarrow/io.pxi":412
 *             c_nbytes = nbytes
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(handle.get().ReadB(c_nbytes, &output))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L6_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/io.pxi":415
 *             check_status(handle.get().ReadB(c_nbytes, &output))
 * 
 *         return pyarrow_wrap_buffer(output)             # <<<<<<<<<<<<<<
 * 
 *     def truncate(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_output); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":396
 *         return line
 * 
 *     def read_buffer(self, nbytes=None):             # <<<<<<<<<<<<<<
 *         cdef:
 *             int64_t c_nbytes
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.read_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":417
 *         return pyarrow_wrap_buffer(output)
 * 
 *     def truncate(self):             # <<<<<<<<<<<<<<
 *         """
 *         NOT IMPLEMENTED
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_57truncate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_56truncate[] = "NativeFile.truncate(self)\n\n        NOT IMPLEMENTED\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_57truncate(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_56truncate(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_56truncate(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":421
 *         NOT IMPLEMENTED
 *         """
 *         raise UnsupportedOperation()             # <<<<<<<<<<<<<<
 * 
 *     def writelines(self, lines):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_UnsupportedOperation); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(6, 421, __pyx_L1_error)

  /* "pyarrow/io.pxi":417
 *         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":423
 *         raise UnsupportedOperation()
 * 
 *     def writelines(self, lines):             # <<<<<<<<<<<<<<
 *         self._assert_writable()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_59writelines(PyObject *__pyx_v_self, PyObject *__pyx_v_lines); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_58writelines[] = "NativeFile.writelines(self, lines)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_59writelines(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_58writelines(((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_58writelines(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":424
 * 
 *     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(6, 424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 424, __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":426
 *         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(6, 426, __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(6, 426, __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(6, 426, __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(6, 426, __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(6, 426, __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(6, 426, __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(6, 426, __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":427
 * 
 *         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(6, 427, __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(6, 427, __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":426
 *         self._assert_writable()
 * 
 *         for line in lines:             # <<<<<<<<<<<<<<
 *             self.write(line)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":423
 *         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":429
 *             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_61download(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_60download[] = "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_61download(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(6, 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_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(6, 429, __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_60download(((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":447
 *             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_9_download *__pyx_cur_scope;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_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_9_download *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "pyarrow/io.pxi":448
 * 
 *             def cleanup():
 *                 stream.close()             # <<<<<<<<<<<<<<
 *         else:
 *             stream = stream_or_path
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_stream)) { __Pyx_RaiseClosureNameError("stream"); __PYX_ERR(6, 448, __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(6, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 448, __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":447
 *             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":452
 *             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":458
 *         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_9_download *__pyx_cur_scope;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_download *__pyx_outer_scope;
  PyObject *__pyx_v_buf = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_e = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_exc_info = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  char const *__pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  char const *__pyx_t_21;
  __Pyx_RefNannySetupContext("bg_write", 0);
  __pyx_outer_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_download *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "pyarrow/io.pxi":459
 * 
 *         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":460
 *         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(6, 460, __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(6, 460, __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(6, 460, __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(6, 460, __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(6, 460, __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":461
 *             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":462
 *                 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(6, 462, __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(6, 462, __pyx_L16_error)
              __Pyx_GOTREF(__pyx_t_7);
              __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 462, __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(6, 462, __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(6, 462, __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":461
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 *                     try:             # <<<<<<<<<<<<<<
 *                         buf = write_queue.get(timeout=0.01)
 *                     except QueueEmpty:
 */
            }
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            goto __pyx_L23_try_end;
            __pyx_L16_error:;
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

            /* "pyarrow/io.pxi":463
 *                     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(6, 463, __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(6, 463, __pyx_L18_except_error)
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_GOTREF(__pyx_t_6);
              __Pyx_GOTREF(__pyx_t_8);

              /* "pyarrow/io.pxi":464
 *                         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":461
 *             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":465
 *                     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(6, 465, __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(6, 465, __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(6, 465, __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":459
 * 
 *         def bg_write():
 *             try:             # <<<<<<<<<<<<<<
 *                 while not done or write_queue.qsize() > 0:
 *                     try:
 */
      }
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L11_try_end;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "pyarrow/io.pxi":466
 *                         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(6, 466, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_6);
        __pyx_v_e = __pyx_t_6;
        /*try:*/ {

          /* "pyarrow/io.pxi":467
 *                     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(6, 467, __pyx_L31_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_15)) __PYX_ERR(6, 467, __pyx_L31_error)
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
            __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_15);
            if (likely(__pyx_t_14)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
              __Pyx_INCREF(__pyx_t_14);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_15, function);
            }
          }
          __pyx_t_12 = (__pyx_t_14) ? __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_14) : __Pyx_PyObject_CallNoArg(__pyx_t_15);
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (unlikely(!__pyx_t_12)) __PYX_ERR(6, 467, __pyx_L31_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __pyx_v_exc_info = __pyx_t_12;
          __pyx_t_12 = 0;
        }

        /* "pyarrow/io.pxi":466
 *                         continue
 *                     stream.write(buf)
 *             except Exception as e:             # <<<<<<<<<<<<<<
 *                 exc_info = sys.exc_info()
 *             finally:
 */
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_DECREF(__pyx_v_e);
            __pyx_v_e = NULL;
            goto __pyx_L32;
          }
          __pyx_L31_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
            if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
            __Pyx_XGOTREF(__pyx_t_11);
            __Pyx_XGOTREF(__pyx_t_10);
            __Pyx_XGOTREF(__pyx_t_9);
            __Pyx_XGOTREF(__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_20);
            __pyx_t_13 = __pyx_lineno; __pyx_t_16 = __pyx_clineno; __pyx_t_17 = __pyx_filename;
            {
              __Pyx_DECREF(__pyx_v_e);
              __pyx_v_e = NULL;
            }
            if (PY_MAJOR_VERSION >= 3) {
              __Pyx_XGIVEREF(__pyx_t_18);
              __Pyx_XGIVEREF(__pyx_t_19);
              __Pyx_XGIVEREF(__pyx_t_20);
              __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
            }
            __Pyx_XGIVEREF(__pyx_t_11);
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_XGIVEREF(__pyx_t_9);
            __Pyx_ErrRestore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
            __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
            __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_16; __pyx_filename = __pyx_t_17;
            goto __pyx_L8_except_error;
          }
          __pyx_L32:;
        }
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L7_exception_handled;
      }
      goto __pyx_L8_except_error;
      __pyx_L8_except_error:;

      /* "pyarrow/io.pxi":459
 * 
 *         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":469
 *                 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(6, 469, __pyx_L1_error) }
      __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_cur_scope->__pyx_v_cleanup); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 469, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L5;
    }
    __pyx_L4_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_19, &__pyx_t_18);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0)) __Pyx_ErrFetch(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_20);
      __Pyx_XGOTREF(__pyx_t_19);
      __Pyx_XGOTREF(__pyx_t_18);
      __pyx_t_16 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_21 = __pyx_filename;
      {
        if (unlikely(!__pyx_cur_scope->__pyx_v_cleanup)) { __Pyx_RaiseClosureNameError("cleanup"); __PYX_ERR(6, 469, __pyx_L38_error) }
        __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_cur_scope->__pyx_v_cleanup); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 469, __pyx_L38_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_20);
        __Pyx_XGIVEREF(__pyx_t_19);
        __Pyx_XGIVEREF(__pyx_t_18);
        __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18);
      }
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_1);
      __Pyx_ErrRestore(__pyx_t_3, __pyx_t_2, __pyx_t_1);
      __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0;
      __pyx_lineno = __pyx_t_16; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_21;
      goto __pyx_L1_error;
      __pyx_L38_error:;
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_20);
        __Pyx_XGIVEREF(__pyx_t_19);
        __Pyx_XGIVEREF(__pyx_t_18);
        __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18);
      }
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L5:;
  }

  /* "pyarrow/io.pxi":458
 *         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":429
 *             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_60download(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_9_download *__pyx_cur_scope;
  int64_t __pyx_v_bytes_read;
  uint8_t *__pyx_v_buf;
  std::shared_ptr<arrow::io::InputStream>  __pyx_v_handle;
  PyObject *__pyx_v_exc_info = NULL;
  PyObject *__pyx_v_bg_write = 0;
  PyObject *__pyx_v_writer_thread = NULL;
  int64_t __pyx_v_total_bytes;
  int32_t __pyx_v_c_buffer_size;
  PyObject *__pyx_v_pybuf = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr<arrow::io::InputStream>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  size_t __pyx_t_7;
  int32_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  char const *__pyx_t_11;
  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("download", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_download *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_9_download(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_9_download, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_download *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(6, 429, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __Pyx_INCREF(__pyx_v_buffer_size);

  /* "pyarrow/io.pxi":435
 *         """
 *         cdef:
 *             int64_t bytes_read = 0             # <<<<<<<<<<<<<<
 *             uint8_t* buf
 * 
 */
  __pyx_v_bytes_read = 0;

  /* "pyarrow/io.pxi":438
 *             uint8_t* buf
 * 
 *         handle = self.get_input_stream()             # <<<<<<<<<<<<<<
 * 
 *         buffer_size = buffer_size or DEFAULT_BUFFER_SIZE
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_self->__pyx_vtab)->get_input_stream(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 438, __pyx_L1_error)
  __pyx_v_handle = __pyx_t_1;

  /* "pyarrow/io.pxi":440
 *         handle = self.get_input_stream()
 * 
 *         buffer_size = buffer_size or DEFAULT_BUFFER_SIZE             # <<<<<<<<<<<<<<
 * 
 *         write_queue = Queue(50)
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_buffer_size); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(6, 440, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __Pyx_INCREF(__pyx_v_buffer_size);
    __pyx_t_2 = __pyx_v_buffer_size;
    goto __pyx_L3_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_DEFAULT_BUFFER_SIZE); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_2 = __pyx_t_4;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_L3_bool_binop_done:;
  __Pyx_DECREF_SET(__pyx_v_buffer_size, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/io.pxi":442
 *         buffer_size = buffer_size or DEFAULT_BUFFER_SIZE
 * 
 *         write_queue = Queue(50)             # <<<<<<<<<<<<<<
 * 
 *         if not hasattr(stream_or_path, 'read'):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Queue); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_int_50) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_50);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_write_queue = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/io.pxi":444
 *         write_queue = Queue(50)
 * 
 *         if not hasattr(stream_or_path, 'read'):             # <<<<<<<<<<<<<<
 *             stream = open(stream_or_path, 'wb')
 * 
 */
  __pyx_t_3 = __Pyx_HasAttr(__pyx_v_stream_or_path, __pyx_n_u_read); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(6, 444, __pyx_L1_error)
  __pyx_t_6 = ((!(__pyx_t_3 != 0)) != 0);
  if (__pyx_t_6) {

    /* "pyarrow/io.pxi":445
 * 
 *         if not hasattr(stream_or_path, 'read'):
 *             stream = open(stream_or_path, 'wb')             # <<<<<<<<<<<<<<
 * 
 *             def cleanup():
 */
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 445, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_stream_or_path);
    __Pyx_GIVEREF(__pyx_v_stream_or_path);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_stream_or_path);
    __Pyx_INCREF(__pyx_n_u_wb);
    __Pyx_GIVEREF(__pyx_n_u_wb);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_u_wb);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 445, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_cur_scope->__pyx_v_stream = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "pyarrow/io.pxi":447
 *             stream = open(stream_or_path, 'wb')
 * 
 *             def cleanup():             # <<<<<<<<<<<<<<
 *                 stream.close()
 *         else:
 */
    __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_10NativeFile_8download_1cleanup, 0, __pyx_n_s_download_locals_cleanup, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pyarrow_lib, __pyx_d, ((PyObject *)__pyx_codeobj__150)); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 447, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_cur_scope->__pyx_v_cleanup = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "pyarrow/io.pxi":444
 *         write_queue = Queue(50)
 * 
 *         if not hasattr(stream_or_path, 'read'):             # <<<<<<<<<<<<<<
 *             stream = open(stream_or_path, 'wb')
 * 
 */
    goto __pyx_L5;
  }

  /* "pyarrow/io.pxi":450
 *                 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":452
 *             stream = stream_or_path
 * 
 *             def cleanup():             # <<<<<<<<<<<<<<
 *                 pass
 * 
 */
    __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_10NativeFile_8download_3cleanup, 0, __pyx_n_s_download_locals_cleanup, NULL, __pyx_n_s_pyarrow_lib, __pyx_d, ((PyObject *)__pyx_codeobj__151)); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_cur_scope->__pyx_v_cleanup = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  __pyx_L5:;

  /* "pyarrow/io.pxi":455
 *                 pass
 * 
 *         done = False             # <<<<<<<<<<<<<<
 *         exc_info = None
 * 
 */
  __pyx_cur_scope->__pyx_v_done = 0;

  /* "pyarrow/io.pxi":456
 * 
 *         done = False
 *         exc_info = None             # <<<<<<<<<<<<<<
 * 
 *         def bg_write():
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_exc_info = Py_None;

  /* "pyarrow/io.pxi":458
 *         exc_info = None
 * 
 *         def bg_write():             # <<<<<<<<<<<<<<
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_10NativeFile_8download_5bg_write, 0, __pyx_n_s_download_locals_bg_write, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pyarrow_lib, __pyx_d, ((PyObject *)__pyx_codeobj__153)); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_bg_write = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyarrow/io.pxi":471
 *                 cleanup()
 * 
 *         self.seek(0)             # <<<<<<<<<<<<<<
 * 
 *         writer_thread = threading.Thread(target=bg_write)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_seek); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_int_0);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/io.pxi":473
 *         self.seek(0)
 * 
 *         writer_thread = threading.Thread(target=bg_write)             # <<<<<<<<<<<<<<
 * 
 *         # This isn't ideal -- PyBytes_FromStringAndSize copies the data from
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_threading); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Thread); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 473, __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(6, 473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_target, __pyx_v_bg_write) < 0) __PYX_ERR(6, 473, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_writer_thread = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "pyarrow/io.pxi":477
 *         # This isn't ideal -- PyBytes_FromStringAndSize copies the data from
 *         # the passed buffer, so it's hard for us to avoid doubling the memory
 *         buf = <uint8_t*> malloc(buffer_size)             # <<<<<<<<<<<<<<
 *         if buf == NULL:
 *             raise MemoryError("Failed to allocate {0} bytes"
 */
  __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_v_buffer_size); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 477, __pyx_L1_error)
  __pyx_v_buf = ((uint8_t *)malloc(__pyx_t_7));

  /* "pyarrow/io.pxi":478
 *         # the passed buffer, so it's hard for us to avoid doubling the memory
 *         buf = <uint8_t*> malloc(buffer_size)
 *         if buf == NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError("Failed to allocate {0} bytes"
 *                               .format(buffer_size))
 */
  __pyx_t_6 = ((__pyx_v_buf == NULL) != 0);
  if (unlikely(__pyx_t_6)) {

    /* "pyarrow/io.pxi":480
 *         if buf == NULL:
 *             raise MemoryError("Failed to allocate {0} bytes"
 *                               .format(buffer_size))             # <<<<<<<<<<<<<<
 * 
 *         writer_thread.start()
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Failed_to_allocate_0_bytes, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 480, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_2, __pyx_v_buffer_size) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_buffer_size);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 480, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/io.pxi":479
 *         buf = <uint8_t*> malloc(buffer_size)
 *         if buf == NULL:
 *             raise MemoryError("Failed to allocate {0} bytes"             # <<<<<<<<<<<<<<
 *                               .format(buffer_size))
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_MemoryError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 479, __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(6, 479, __pyx_L1_error)

    /* "pyarrow/io.pxi":478
 *         # 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":482
 *                               .format(buffer_size))
 * 
 *         writer_thread.start()             # <<<<<<<<<<<<<<
 * 
 *         cdef int64_t total_bytes = 0
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer_thread, __pyx_n_s_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/io.pxi":484
 *         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":485
 * 
 *         cdef int64_t total_bytes = 0
 *         cdef int32_t c_buffer_size = buffer_size             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
  __pyx_t_8 = __Pyx_PyInt_As_int32_t(__pyx_v_buffer_size); if (unlikely((__pyx_t_8 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 485, __pyx_L1_error)
  __pyx_v_c_buffer_size = __pyx_t_8;

  /* "pyarrow/io.pxi":487
 *         cdef int32_t c_buffer_size = buffer_size
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             while True:
 *                 with nogil:
 */
  /*try:*/ {

    /* "pyarrow/io.pxi":488
 * 
 *         try:
 *             while True:             # <<<<<<<<<<<<<<
 *                 with nogil:
 *                     check_status(handle.get()
 */
    while (1) {

      /* "pyarrow/io.pxi":489
 *         try:
 *             while True:
 *                 with nogil:             # <<<<<<<<<<<<<<
 *                     check_status(handle.get()
 *                                  .Read(c_buffer_size, &bytes_read, buf))
 */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          __Pyx_FastGIL_Remember();
          #endif
          /*try:*/ {

            /* "pyarrow/io.pxi":490
 *             while True:
 *                 with nogil:
 *                     check_status(handle.get()             # <<<<<<<<<<<<<<
 *                                  .Read(c_buffer_size, &bytes_read, buf))
 * 
 */
            __pyx_t_9 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_handle.get()->Read(__pyx_v_c_buffer_size, (&__pyx_v_bytes_read), __pyx_v_buf)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(6, 490, __pyx_L15_error)
          }

          /* "pyarrow/io.pxi":489
 *         try:
 *             while True:
 *                 with nogil:             # <<<<<<<<<<<<<<
 *                     check_status(handle.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":493
 *                                  .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":496
 * 
 *                 # EOF
 *                 if bytes_read == 0:             # <<<<<<<<<<<<<<
 *                     break
 * 
 */
      __pyx_t_6 = ((__pyx_v_bytes_read == 0) != 0);
      if (__pyx_t_6) {

        /* "pyarrow/io.pxi":497
 *                 # EOF
 *                 if bytes_read == 0:
 *                     break             # <<<<<<<<<<<<<<
 * 
 *                 pybuf = cp.PyBytes_FromStringAndSize(<const char*>buf,
 */
        goto __pyx_L11_break;

        /* "pyarrow/io.pxi":496
 * 
 *                 # EOF
 *                 if bytes_read == 0:             # <<<<<<<<<<<<<<
 *                     break
 * 
 */
      }

      /* "pyarrow/io.pxi":499
 *                     break
 * 
 *                 pybuf = cp.PyBytes_FromStringAndSize(<const char*>buf,             # <<<<<<<<<<<<<<
 *                                                      bytes_read)
 * 
 */
      __pyx_t_4 = PyBytes_FromStringAndSize(((char const *)__pyx_v_buf), __pyx_v_bytes_read); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 499, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_pybuf, ((PyObject*)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "pyarrow/io.pxi":502
 *                                                      bytes_read)
 * 
 *                 if writer_thread.is_alive():             # <<<<<<<<<<<<<<
 *                     while write_queue.full():
 *                         time.sleep(0.01)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer_thread, __pyx_n_s_is_alive); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 502, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 502, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(6, 502, __pyx_L8_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {

        /* "pyarrow/io.pxi":503
 * 
 *                 if writer_thread.is_alive():
 *                     while write_queue.full():             # <<<<<<<<<<<<<<
 *                         time.sleep(0.01)
 *                 else:
 */
        while (1) {
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_write_queue, __pyx_n_s_full); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 503, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_2 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
            if (likely(__pyx_t_2)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_5, function);
            }
          }
          __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 503, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(6, 503, __pyx_L8_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (!__pyx_t_6) break;

          /* "pyarrow/io.pxi":504
 *                 if writer_thread.is_alive():
 *                     while write_queue.full():
 *                         time.sleep(0.01)             # <<<<<<<<<<<<<<
 *                 else:
 *                     break
 */
          __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 504, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sleep); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 504, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_5)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_5);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
            }
          }
          __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_float_0_01) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_float_0_01);
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 504, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }

        /* "pyarrow/io.pxi":502
 *                                                      bytes_read)
 * 
 *                 if writer_thread.is_alive():             # <<<<<<<<<<<<<<
 *                     while write_queue.full():
 *                         time.sleep(0.01)
 */
        goto __pyx_L18;
      }

      /* "pyarrow/io.pxi":506
 *                         time.sleep(0.01)
 *                 else:
 *                     break             # <<<<<<<<<<<<<<
 * 
 *                 write_queue.put_nowait(pybuf)
 */
      /*else*/ {
        goto __pyx_L11_break;
      }
      __pyx_L18:;

      /* "pyarrow/io.pxi":508
 *                     break
 * 
 *                 write_queue.put_nowait(pybuf)             # <<<<<<<<<<<<<<
 *         finally:
 *             free(buf)
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_write_queue, __pyx_n_s_put_nowait); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 508, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_v_pybuf) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_pybuf);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 508, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_L11_break:;
  }

  /* "pyarrow/io.pxi":510
 *                 write_queue.put_nowait(pybuf)
 *         finally:
 *             free(buf)             # <<<<<<<<<<<<<<
 *             done = True
 * 
 */
  /*finally:*/ {
    /*normal exit:*/{
      free(__pyx_v_buf);

      /* "pyarrow/io.pxi":511
 *         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_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
      __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_XGOTREF(__pyx_t_17);
      __pyx_t_9 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename;
      {

        /* "pyarrow/io.pxi":510
 *                 write_queue.put_nowait(pybuf)
 *         finally:
 *             free(buf)             # <<<<<<<<<<<<<<
 *             done = True
 * 
 */
        free(__pyx_v_buf);

        /* "pyarrow/io.pxi":511
 *         finally:
 *             free(buf)
 *             done = True             # <<<<<<<<<<<<<<
 * 
 *         writer_thread.join()
 */
        __pyx_cur_scope->__pyx_v_done = 1;
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
      }
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11;
      goto __pyx_L1_error;
    }
    __pyx_L9:;
  }

  /* "pyarrow/io.pxi":513
 *             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(6, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/io.pxi":514
 * 
 *         writer_thread.join()
 *         if exc_info is not None:             # <<<<<<<<<<<<<<
 *             raise exc_info[0], exc_info[1], exc_info[2]
 * 
 */
  __pyx_t_6 = (__pyx_v_exc_info != Py_None);
  __pyx_t_3 = (__pyx_t_6 != 0);
  if (unlikely(__pyx_t_3)) {

    /* "pyarrow/io.pxi":515
 *         writer_thread.join()
 *         if exc_info is not None:
 *             raise exc_info[0], exc_info[1], exc_info[2]             # <<<<<<<<<<<<<<
 * 
 *     def upload(self, stream, buffer_size=None):
 */
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_exc_info, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_exc_info, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_Raise(__pyx_t_4, __pyx_t_2, __pyx_t_5, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(6, 515, __pyx_L1_error)

    /* "pyarrow/io.pxi":514
 * 
 *         writer_thread.join()
 *         if exc_info is not None:             # <<<<<<<<<<<<<<
 *             raise exc_info[0], exc_info[1], exc_info[2]
 * 
 */
  }

  /* "pyarrow/io.pxi":429
 *             self.write(line)
 * 
 *     def download(self, stream_or_path, buffer_size=None):             # <<<<<<<<<<<<<<
 *         """
 *         Read file completely to local path (rather than reading completely into
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.download", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_exc_info);
  __Pyx_XDECREF(__pyx_v_bg_write);
  __Pyx_XDECREF(__pyx_v_writer_thread);
  __Pyx_XDECREF(__pyx_v_pybuf);
  __Pyx_XDECREF(__pyx_v_buffer_size);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":517
 *             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_63upload(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_62upload[] = "NativeFile.upload(self, stream, buffer_size=None)\n\n        Pipe file-like object to file\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_63upload(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(6, 517, __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(6, 517, __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_62upload(((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":529
 *         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_10_upload *__pyx_cur_scope;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_upload *__pyx_outer_scope;
  PyObject *__pyx_v_buf = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_e = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_exc_info = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  char const *__pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("bg_write", 0);
  __pyx_outer_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_upload *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "pyarrow/io.pxi":530
 * 
 *         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":531
 *         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(6, 531, __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(6, 531, __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(6, 531, __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(6, 531, __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(6, 531, __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":532
 *             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":533
 *                 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(6, 533, __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(6, 533, __pyx_L13_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 533, __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(6, 533, __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(6, 533, __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":532
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 *                     try:             # <<<<<<<<<<<<<<
 *                         buf = write_queue.get(timeout=0.01)
 *                     except QueueEmpty:
 */
          }
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          goto __pyx_L20_try_end;
          __pyx_L13_error:;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

          /* "pyarrow/io.pxi":534
 *                     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(6, 534, __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(6, 534, __pyx_L15_except_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_GOTREF(__pyx_t_8);

            /* "pyarrow/io.pxi":535
 *                         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":532
 *             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":537
 *                         continue
 * 
 *                     self.write(buf)             # <<<<<<<<<<<<<<
 * 
 *             except Exception as e:
 */
        if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(6, 537, __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(6, 537, __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(6, 537, __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":530
 * 
 *         def bg_write():
 *             try:             # <<<<<<<<<<<<<<
 *                 while not done or write_queue.qsize() > 0:
 *                     try:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "pyarrow/io.pxi":539
 *                     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(6, 539, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_e = __pyx_t_6;
      /*try:*/ {

        /* "pyarrow/io.pxi":540
 * 
 *             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(6, 540, __pyx_L28_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_15)) __PYX_ERR(6, 540, __pyx_L28_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_14 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
          __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_15);
          if (likely(__pyx_t_14)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_15, function);
          }
        }
        __pyx_t_12 = (__pyx_t_14) ? __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_14) : __Pyx_PyObject_CallNoArg(__pyx_t_15);
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        if (unlikely(!__pyx_t_12)) __PYX_ERR(6, 540, __pyx_L28_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __pyx_v_exc_info = __pyx_t_12;
        __pyx_t_12 = 0;
      }

      /* "pyarrow/io.pxi":539
 *                     self.write(buf)
 * 
 *             except Exception as e:             # <<<<<<<<<<<<<<
 *                 exc_info = sys.exc_info()
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_e);
          __pyx_v_e = NULL;
          goto __pyx_L29;
        }
        __pyx_L28_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_11);
          __Pyx_XGOTREF(__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_13 = __pyx_lineno; __pyx_t_16 = __pyx_clineno; __pyx_t_17 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_e);
            __pyx_v_e = NULL;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_ErrRestore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
          __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_16; __pyx_filename = __pyx_t_17;
          goto __pyx_L5_except_error;
        }
        __pyx_L29:;
      }
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/io.pxi":530
 * 
 *         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":529
 *         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":517
 *             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_62upload(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_10_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_10_upload *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_10_upload(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_10_upload, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_upload *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(6, 517, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_INCREF(__pyx_v_buffer_size);

  /* "pyarrow/io.pxi":521
 *         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(6, 521, __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(6, 521, __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":522
 *         """
 *         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(6, 522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 522, __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":524
 *         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(6, 524, __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(6, 524, __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":526
 *         buffer_size = buffer_size or DEFAULT_BUFFER_SIZE
 * 
 *         done = False             # <<<<<<<<<<<<<<
 *         exc_info = None
 * 
 */
  __pyx_cur_scope->__pyx_v_done = 0;

  /* "pyarrow/io.pxi":527
 * 
 *         done = False
 *         exc_info = None             # <<<<<<<<<<<<<<
 * 
 *         def bg_write():
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_exc_info = Py_None;

  /* "pyarrow/io.pxi":529
 *         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__155)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_bg_write = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":542
 *                 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(6, 542, __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(6, 542, __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(6, 542, __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(6, 542, __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(6, 542, __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":543
 * 
 *         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(6, 543, __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(6, 543, __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":545
 *         writer_thread.start()
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             while True:
 *                 buf = stream.read(buffer_size)
 */
  /*try:*/ {

    /* "pyarrow/io.pxi":546
 * 
 *         try:
 *             while True:             # <<<<<<<<<<<<<<
 *                 buf = stream.read(buffer_size)
 *                 if not buf:
 */
    while (1) {

      /* "pyarrow/io.pxi":547
 *         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(6, 547, __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(6, 547, __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":548
 *             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(6, 548, __pyx_L6_error)
      __pyx_t_5 = ((!__pyx_t_4) != 0);
      if (__pyx_t_5) {

        /* "pyarrow/io.pxi":549
 *                 buf = stream.read(buffer_size)
 *                 if not buf:
 *                     break             # <<<<<<<<<<<<<<
 * 
 *                 if writer_thread.is_alive():
 */
        goto __pyx_L9_break;

        /* "pyarrow/io.pxi":548
 *             while True:
 *                 buf = stream.read(buffer_size)
 *                 if not buf:             # <<<<<<<<<<<<<<
 *                     break
 * 
 */
      }

      /* "pyarrow/io.pxi":551
 *                     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(6, 551, __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(6, 551, __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(6, 551, __pyx_L6_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_5) {

        /* "pyarrow/io.pxi":552
 * 
 *                 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(6, 552, __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(6, 552, __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(6, 552, __pyx_L6_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (!__pyx_t_5) break;

          /* "pyarrow/io.pxi":553
 *                 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(6, 553, __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(6, 553, __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(6, 553, __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":551
 *                     break
 * 
 *                 if writer_thread.is_alive():             # <<<<<<<<<<<<<<
 *                     while write_queue.full():
 *                         time.sleep(0.01)
 */
        goto __pyx_L11;
      }

      /* "pyarrow/io.pxi":555
 *                         time.sleep(0.01)
 *                 else:
 *                     break             # <<<<<<<<<<<<<<
 * 
 *                 write_queue.put_nowait(buf)
 */
      /*else*/ {
        goto __pyx_L9_break;
      }
      __pyx_L11:;

      /* "pyarrow/io.pxi":557
 *                     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(6, 557, __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(6, 557, __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":559
 *                 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":561
 *             done = True
 * 
 *         writer_thread.join()             # <<<<<<<<<<<<<<
 *         if exc_info is not None:
 *             raise exc_info[0], exc_info[1], exc_info[2]
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer_thread, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 561, __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(6, 561, __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":562
 * 
 *         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":563
 *         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(6, 563, __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(6, 563, __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(6, 563, __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(6, 563, __pyx_L1_error)

    /* "pyarrow/io.pxi":562
 * 
 *         writer_thread.join()
 *         if exc_info is not None:             # <<<<<<<<<<<<<<
 *             raise exc_info[0], exc_info[1], exc_info[2]
 * 
 */
  }

  /* "pyarrow/io.pxi":517
 *             raise exc_info[0], exc_info[1], exc_info[2]
 * 
 *     def upload(self, stream, buffer_size=None):             # <<<<<<<<<<<<<<
 *         """
 *         Pipe file-like object to file
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.upload", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_exc_info);
  __Pyx_XDECREF(__pyx_v_bg_write);
  __Pyx_XDECREF(__pyx_v_writer_thread);
  __Pyx_XDECREF(__pyx_v_buf);
  __Pyx_XDECREF(__pyx_v_buffer_size);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_65__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_64__reduce_cython__[] = "NativeFile.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_65__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_64__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_64__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__156, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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_67__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_66__setstate_cython__[] = "NativeFile.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_67__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_66__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_66__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__157, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":585
 *         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(6, 585, __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(6, 585, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.PythonFile.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10PythonFile___cinit__(((struct __pyx_obj_7pyarrow_3lib_PythonFile *)__pyx_v_self), __pyx_v_handle, __pyx_v_mode);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_10PythonFile___cinit__(struct __pyx_obj_7pyarrow_3lib_PythonFile *__pyx_v_self, PyObject *__pyx_v_handle, PyObject *__pyx_v_mode) {
  PyObject *__pyx_v_inferred_mode = NULL;
  PyObject *__pyx_v_kind = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  Py_ssize_t __pyx_t_17;
  Py_UCS4 __pyx_t_18;
  PyObject *__pyx_t_19 = NULL;
  int __pyx_t_20;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/io.pxi":586
 * 
 *     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":588
 *         self.handle = handle
 * 
 *         if mode is None:             # <<<<<<<<<<<<<<
 *             try:
 *                 inferred_mode = handle.mode
 */
  __pyx_t_1 = (__pyx_v_mode == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/io.pxi":589
 * 
 *         if mode is None:
 *             try:             # <<<<<<<<<<<<<<
 *                 inferred_mode = handle.mode
 *             except AttributeError:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      /*try:*/ {

        /* "pyarrow/io.pxi":590
 *         if mode is None:
 *             try:
 *                 inferred_mode = handle.mode             # <<<<<<<<<<<<<<
 *             except AttributeError:
 *                 # Not all file-like objects have a mode attribute
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_handle, __pyx_n_s_mode); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 590, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_v_inferred_mode = __pyx_t_6;
        __pyx_t_6 = 0;

        /* "pyarrow/io.pxi":589
 * 
 *         if mode is None:
 *             try:             # <<<<<<<<<<<<<<
 *                 inferred_mode = handle.mode
 *             except AttributeError:
 */
      }
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L9_try_end;
      __pyx_L4_error:;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "pyarrow/io.pxi":591
 *             try:
 *                 inferred_mode = handle.mode
 *             except AttributeError:             # <<<<<<<<<<<<<<
 *                 # Not all file-like objects have a mode attribute
 *                 # (e.g. BytesIO)
 */
      __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
      if (__pyx_t_7) {
        __Pyx_AddTraceback("pyarrow.lib.PythonFile.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(6, 591, __pyx_L6_except_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GOTREF(__pyx_t_9);

        /* "pyarrow/io.pxi":594
 *                 # Not all file-like objects have a mode attribute
 *                 # (e.g. BytesIO)
 *                 try:             # <<<<<<<<<<<<<<
 *                     inferred_mode = 'w' if handle.writable() else 'r'
 *                 except AttributeError:
 */
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
          __Pyx_XGOTREF(__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_11);
          __Pyx_XGOTREF(__pyx_t_12);
          /*try:*/ {

            /* "pyarrow/io.pxi":595
 *                 # (e.g. BytesIO)
 *                 try:
 *                     inferred_mode = 'w' if handle.writable() else 'r'             # <<<<<<<<<<<<<<
 *                 except AttributeError:
 *                     raise ValueError("could not infer open mode for file-like "
 */
            __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_handle, __pyx_n_s_writable); if (unlikely(!__pyx_t_15)) __PYX_ERR(6, 595, __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(6, 595, __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(6, 595, __pyx_L12_error)
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            if (__pyx_t_2) {
              __Pyx_INCREF(__pyx_n_u_w);
              __pyx_t_13 = __pyx_n_u_w;
            } else {
              __Pyx_INCREF(__pyx_n_u_r);
              __pyx_t_13 = __pyx_n_u_r;
            }
            __Pyx_XDECREF_SET(__pyx_v_inferred_mode, __pyx_t_13);
            __pyx_t_13 = 0;

            /* "pyarrow/io.pxi":594
 *                 # Not all file-like objects have a mode attribute
 *                 # (e.g. BytesIO)
 *                 try:             # <<<<<<<<<<<<<<
 *                     inferred_mode = 'w' if handle.writable() else 'r'
 *                 except AttributeError:
 */
          }
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          goto __pyx_L19_try_end;
          __pyx_L12_error:;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;

          /* "pyarrow/io.pxi":596
 *                 try:
 *                     inferred_mode = 'w' if handle.writable() else 'r'
 *                 except AttributeError:             # <<<<<<<<<<<<<<
 *                     raise ValueError("could not infer open mode for file-like "
 *                                      "object %r, please pass it explicitly"
 */
          __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
          if (__pyx_t_7) {
            __Pyx_AddTraceback("pyarrow.lib.PythonFile.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0) __PYX_ERR(6, 596, __pyx_L14_except_error)
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_GOTREF(__pyx_t_15);

            /* "pyarrow/io.pxi":597
 *                     inferred_mode = 'w' if handle.writable() else 'r'
 *                 except AttributeError:
 *                     raise ValueError("could not infer open mode for file-like "             # <<<<<<<<<<<<<<
 *                                      "object %r, please pass it explicitly"
 *                                      % (handle,))
 */
            __pyx_t_16 = PyTuple_New(3); if (unlikely(!__pyx_t_16)) __PYX_ERR(6, 597, __pyx_L14_except_error)
            __Pyx_GOTREF(__pyx_t_16);
            __pyx_t_17 = 0;
            __pyx_t_18 = 127;
            __Pyx_INCREF(__pyx_kp_u_could_not_infer_open_mode_for_fi);
            __pyx_t_17 += 47;
            __Pyx_GIVEREF(__pyx_kp_u_could_not_infer_open_mode_for_fi);
            PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_kp_u_could_not_infer_open_mode_for_fi);

            /* "pyarrow/io.pxi":599
 *                     raise ValueError("could not infer open mode for file-like "
 *                                      "object %r, please pass it explicitly"
 *                                      % (handle,))             # <<<<<<<<<<<<<<
 *         else:
 *             inferred_mode = mode
 */
            __pyx_t_19 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_handle), __pyx_empty_unicode); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 599, __pyx_L14_except_error)
            __Pyx_GOTREF(__pyx_t_19);
            __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) : __pyx_t_18;
            __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_19);
            __Pyx_GIVEREF(__pyx_t_19);
            PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_19);
            __pyx_t_19 = 0;
            __Pyx_INCREF(__pyx_kp_u_please_pass_it_explicitly);
            __pyx_t_17 += 27;
            __Pyx_GIVEREF(__pyx_kp_u_please_pass_it_explicitly);
            PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_kp_u_please_pass_it_explicitly);

            /* "pyarrow/io.pxi":597
 *                     inferred_mode = 'w' if handle.writable() else 'r'
 *                 except AttributeError:
 *                     raise ValueError("could not infer open mode for file-like "             # <<<<<<<<<<<<<<
 *                                      "object %r, please pass it explicitly"
 *                                      % (handle,))
 */
            __pyx_t_19 = __Pyx_PyUnicode_Join(__pyx_t_16, 3, __pyx_t_17, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 597, __pyx_L14_except_error)
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            __pyx_t_16 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_19); if (unlikely(!__pyx_t_16)) __PYX_ERR(6, 597, __pyx_L14_except_error)
            __Pyx_GOTREF(__pyx_t_16);
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            __Pyx_Raise(__pyx_t_16, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            __PYX_ERR(6, 597, __pyx_L14_except_error)
          }
          goto __pyx_L14_except_error;
          __pyx_L14_except_error:;

          /* "pyarrow/io.pxi":594
 *                 # Not all file-like objects have a mode attribute
 *                 # (e.g. BytesIO)
 *                 try:             # <<<<<<<<<<<<<<
 *                     inferred_mode = 'w' if handle.writable() else 'r'
 *                 except AttributeError:
 */
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
          goto __pyx_L6_except_error;
          __pyx_L19_try_end:;
        }
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L5_exception_handled;
      }
      goto __pyx_L6_except_error;
      __pyx_L6_except_error:;

      /* "pyarrow/io.pxi":589
 * 
 *         if mode is None:
 *             try:             # <<<<<<<<<<<<<<
 *                 inferred_mode = handle.mode
 *             except AttributeError:
 */
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      goto __pyx_L1_error;
      __pyx_L5_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      __pyx_L9_try_end:;
    }

    /* "pyarrow/io.pxi":588
 *         self.handle = handle
 * 
 *         if mode is None:             # <<<<<<<<<<<<<<
 *             try:
 *                 inferred_mode = handle.mode
 */
    goto __pyx_L3;
  }

  /* "pyarrow/io.pxi":601
 *                                      % (handle,))
 *         else:
 *             inferred_mode = mode             # <<<<<<<<<<<<<<
 * 
 *         if inferred_mode.startswith('w'):
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_v_mode);
    __pyx_v_inferred_mode = __pyx_v_mode;
  }
  __pyx_L3:;

  /* "pyarrow/io.pxi":603
 *             inferred_mode = mode
 * 
 *         if inferred_mode.startswith('w'):             # <<<<<<<<<<<<<<
 *             kind = 'w'
 *         elif inferred_mode.startswith('r'):
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_inferred_mode, __pyx_n_s_startswith); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  __pyx_t_9 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_6, __pyx_n_u_w) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_n_u_w);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 603, __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(6, 603, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (__pyx_t_2) {

    /* "pyarrow/io.pxi":604
 * 
 *         if inferred_mode.startswith('w'):
 *             kind = 'w'             # <<<<<<<<<<<<<<
 *         elif inferred_mode.startswith('r'):
 *             kind = 'r'
 */
    __Pyx_INCREF(__pyx_n_u_w);
    __pyx_v_kind = __pyx_n_u_w;

    /* "pyarrow/io.pxi":603
 *             inferred_mode = mode
 * 
 *         if inferred_mode.startswith('w'):             # <<<<<<<<<<<<<<
 *             kind = 'w'
 *         elif inferred_mode.startswith('r'):
 */
    goto __pyx_L22;
  }

  /* "pyarrow/io.pxi":605
 *         if inferred_mode.startswith('w'):
 *             kind = 'w'
 *         elif inferred_mode.startswith('r'):             # <<<<<<<<<<<<<<
 *             kind = 'r'
 *         else:
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_inferred_mode, __pyx_n_s_startswith); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  __pyx_t_9 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_6, __pyx_n_u_r) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_n_u_r);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 605, __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(6, 605, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (likely(__pyx_t_2)) {

    /* "pyarrow/io.pxi":606
 *             kind = 'w'
 *         elif inferred_mode.startswith('r'):
 *             kind = 'r'             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError('Invalid file mode: {0}'.format(mode))
 */
    __Pyx_INCREF(__pyx_n_u_r);
    __pyx_v_kind = __pyx_n_u_r;

    /* "pyarrow/io.pxi":605
 *         if inferred_mode.startswith('w'):
 *             kind = 'w'
 *         elif inferred_mode.startswith('r'):             # <<<<<<<<<<<<<<
 *             kind = 'r'
 *         else:
 */
    goto __pyx_L22;
  }

  /* "pyarrow/io.pxi":608
 *             kind = 'r'
 *         else:
 *             raise ValueError('Invalid file mode: {0}'.format(mode))             # <<<<<<<<<<<<<<
 * 
 *         # If mode was given, check it matches the given file
 */
  /*else*/ {
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Invalid_file_mode_0, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 608, __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(6, 608, __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(6, 608, __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(6, 608, __pyx_L1_error)
  }
  __pyx_L22:;

  /* "pyarrow/io.pxi":611
 * 
 *         # If mode was given, check it matches the given file
 *         if mode is not None:             # <<<<<<<<<<<<<<
 *             if isinstance(handle, IOBase):
 *                 # Python 3 IO object
 */
  __pyx_t_2 = (__pyx_v_mode != Py_None);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":612
 *         # If mode was given, check it matches the given file
 *         if mode is not None:
 *             if isinstance(handle, IOBase):             # <<<<<<<<<<<<<<
 *                 # Python 3 IO object
 *                 if kind == 'r':
 */
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_IOBase); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 612, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_1 = PyObject_IsInstance(__pyx_v_handle, __pyx_t_8); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 612, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "pyarrow/io.pxi":614
 *             if isinstance(handle, IOBase):
 *                 # Python 3 IO object
 *                 if kind == 'r':             # <<<<<<<<<<<<<<
 *                     if not handle.readable():
 *                         raise TypeError("readable file expected")
 */
      __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_kind, __pyx_n_u_r, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 614, __pyx_L1_error)
      __pyx_t_1 = (__pyx_t_2 != 0);
      if (__pyx_t_1) {

        /* "pyarrow/io.pxi":615
 *                 # Python 3 IO object
 *                 if kind == 'r':
 *                     if not handle.readable():             # <<<<<<<<<<<<<<
 *                         raise TypeError("readable file expected")
 *                 else:
 */
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_handle, __pyx_n_s_readable); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 615, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_6 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
          }
        }
        __pyx_t_8 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 615, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 615, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_2 = ((!__pyx_t_1) != 0);
        if (unlikely(__pyx_t_2)) {

          /* "pyarrow/io.pxi":616
 *                 if kind == 'r':
 *                     if not handle.readable():
 *                         raise TypeError("readable file expected")             # <<<<<<<<<<<<<<
 *                 else:
 *                     if not handle.writable():
 */
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__158, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 616, __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(6, 616, __pyx_L1_error)

          /* "pyarrow/io.pxi":615
 *                 # Python 3 IO object
 *                 if kind == 'r':
 *                     if not handle.readable():             # <<<<<<<<<<<<<<
 *                         raise TypeError("readable file expected")
 *                 else:
 */
        }

        /* "pyarrow/io.pxi":614
 *             if isinstance(handle, IOBase):
 *                 # Python 3 IO object
 *                 if kind == 'r':             # <<<<<<<<<<<<<<
 *                     if not handle.readable():
 *                         raise TypeError("readable file expected")
 */
        goto __pyx_L25;
      }

      /* "pyarrow/io.pxi":618
 *                         raise TypeError("readable file expected")
 *                 else:
 *                     if not handle.writable():             # <<<<<<<<<<<<<<
 *                         raise TypeError("writable file expected")
 *             elif file_type is not None and isinstance(handle, file_type):
 */
      /*else*/ {
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_handle, __pyx_n_s_writable); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 618, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_6 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
          }
        }
        __pyx_t_8 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 618, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 618, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_1 = ((!__pyx_t_2) != 0);
        if (unlikely(__pyx_t_1)) {

          /* "pyarrow/io.pxi":619
 *                 else:
 *                     if not handle.writable():
 *                         raise TypeError("writable file expected")             # <<<<<<<<<<<<<<
 *             elif file_type is not None and isinstance(handle, file_type):
 *                 # Python 2 file type
 */
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__159, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 619, __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(6, 619, __pyx_L1_error)

          /* "pyarrow/io.pxi":618
 *                         raise TypeError("readable file expected")
 *                 else:
 *                     if not handle.writable():             # <<<<<<<<<<<<<<
 *                         raise TypeError("writable file expected")
 *             elif file_type is not None and isinstance(handle, file_type):
 */
        }
      }
      __pyx_L25:;

      /* "pyarrow/io.pxi":612
 *         # If mode was given, check it matches the given file
 *         if mode is not None:
 *             if isinstance(handle, IOBase):             # <<<<<<<<<<<<<<
 *                 # Python 3 IO object
 *                 if kind == 'r':
 */
      goto __pyx_L24;
    }

    /* "pyarrow/io.pxi":620
 *                     if not handle.writable():
 *                         raise TypeError("writable file expected")
 *             elif file_type is not None and isinstance(handle, file_type):             # <<<<<<<<<<<<<<
 *                 # Python 2 file type
 *                 if kind == 'r':
 */
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_file_type); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 620, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_2 = (__pyx_t_8 != Py_None);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_20 = (__pyx_t_2 != 0);
    if (__pyx_t_20) {
    } else {
      __pyx_t_1 = __pyx_t_20;
      goto __pyx_L28_bool_binop_done;
    }
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_file_type); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 620, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_20 = PyObject_IsInstance(__pyx_v_handle, __pyx_t_8); if (unlikely(__pyx_t_20 == ((int)-1))) __PYX_ERR(6, 620, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_2 = (__pyx_t_20 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L28_bool_binop_done:;
    if (__pyx_t_1) {

      /* "pyarrow/io.pxi":622
 *             elif file_type is not None and isinstance(handle, file_type):
 *                 # Python 2 file type
 *                 if kind == 'r':             # <<<<<<<<<<<<<<
 *                     if 'r' not in handle.mode and '+' not in handle.mode:
 *                         raise TypeError("readable file expected")
 */
      __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_kind, __pyx_n_u_r, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 622, __pyx_L1_error)
      __pyx_t_2 = (__pyx_t_1 != 0);
      if (__pyx_t_2) {

        /* "pyarrow/io.pxi":623
 *                 # Python 2 file type
 *                 if kind == 'r':
 *                     if 'r' not in handle.mode and '+' not in handle.mode:             # <<<<<<<<<<<<<<
 *                         raise TypeError("readable file expected")
 *                 else:
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_handle, __pyx_n_s_mode); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_r, __pyx_t_8, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 623, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_20 = (__pyx_t_1 != 0);
        if (__pyx_t_20) {
        } else {
          __pyx_t_2 = __pyx_t_20;
          goto __pyx_L32_bool_binop_done;
        }
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_handle, __pyx_n_s_mode); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_20 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__17, __pyx_t_8, Py_NE)); if (unlikely(__pyx_t_20 < 0)) __PYX_ERR(6, 623, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_1 = (__pyx_t_20 != 0);
        __pyx_t_2 = __pyx_t_1;
        __pyx_L32_bool_binop_done:;
        if (unlikely(__pyx_t_2)) {

          /* "pyarrow/io.pxi":624
 *                 if kind == 'r':
 *                     if 'r' not in handle.mode and '+' not in handle.mode:
 *                         raise TypeError("readable file expected")             # <<<<<<<<<<<<<<
 *                 else:
 *                     if 'w' not in handle.mode and '+' not in handle.mode:
 */
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__158, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 624, __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(6, 624, __pyx_L1_error)

          /* "pyarrow/io.pxi":623
 *                 # Python 2 file type
 *                 if kind == 'r':
 *                     if 'r' not in handle.mode and '+' not in handle.mode:             # <<<<<<<<<<<<<<
 *                         raise TypeError("readable file expected")
 *                 else:
 */
        }

        /* "pyarrow/io.pxi":622
 *             elif file_type is not None and isinstance(handle, file_type):
 *                 # Python 2 file type
 *                 if kind == 'r':             # <<<<<<<<<<<<<<
 *                     if 'r' not in handle.mode and '+' not in handle.mode:
 *                         raise TypeError("readable file expected")
 */
        goto __pyx_L30;
      }

      /* "pyarrow/io.pxi":626
 *                         raise TypeError("readable file expected")
 *                 else:
 *                     if 'w' not in handle.mode and '+' not in handle.mode:             # <<<<<<<<<<<<<<
 *                         raise TypeError("writable file expected")
 *             # (other duck-typed file-like objects are possible)
 */
      /*else*/ {
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_handle, __pyx_n_s_mode); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 626, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_w, __pyx_t_8, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 626, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_20 = (__pyx_t_1 != 0);
        if (__pyx_t_20) {
        } else {
          __pyx_t_2 = __pyx_t_20;
          goto __pyx_L35_bool_binop_done;
        }
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_handle, __pyx_n_s_mode); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 626, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_20 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__17, __pyx_t_8, Py_NE)); if (unlikely(__pyx_t_20 < 0)) __PYX_ERR(6, 626, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_1 = (__pyx_t_20 != 0);
        __pyx_t_2 = __pyx_t_1;
        __pyx_L35_bool_binop_done:;
        if (unlikely(__pyx_t_2)) {

          /* "pyarrow/io.pxi":627
 *                 else:
 *                     if 'w' not in handle.mode and '+' not in handle.mode:
 *                         raise TypeError("writable file expected")             # <<<<<<<<<<<<<<
 *             # (other duck-typed file-like objects are possible)
 * 
 */
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__159, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 627, __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(6, 627, __pyx_L1_error)

          /* "pyarrow/io.pxi":626
 *                         raise TypeError("readable file expected")
 *                 else:
 *                     if 'w' not in handle.mode and '+' not in handle.mode:             # <<<<<<<<<<<<<<
 *                         raise TypeError("writable file expected")
 *             # (other duck-typed file-like objects are possible)
 */
        }
      }
      __pyx_L30:;

      /* "pyarrow/io.pxi":620
 *                     if not handle.writable():
 *                         raise TypeError("writable file expected")
 *             elif file_type is not None and isinstance(handle, file_type):             # <<<<<<<<<<<<<<
 *                 # Python 2 file type
 *                 if kind == 'r':
 */
    }
    __pyx_L24:;

    /* "pyarrow/io.pxi":611
 * 
 *         # If mode was given, check it matches the given file
 *         if mode is not None:             # <<<<<<<<<<<<<<
 *             if isinstance(handle, IOBase):
 *                 # Python 3 IO object
 */
  }

  /* "pyarrow/io.pxi":630
 *             # (other duck-typed file-like objects are possible)
 * 
 *         if kind == 'r':             # <<<<<<<<<<<<<<
 *             self.set_random_access_file(
 *                 shared_ptr[RandomAccessFile](new PyReadableFile(handle)))
 */
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_kind, __pyx_n_u_r, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 630, __pyx_L1_error)
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":631
 * 
 *         if kind == 'r':
 *             self.set_random_access_file(             # <<<<<<<<<<<<<<
 *                 shared_ptr[RandomAccessFile](new PyReadableFile(handle)))
 *             self.is_readable = True
 */
    __pyx_t_8 = ((struct __pyx_vtabstruct_7pyarrow_3lib_PythonFile *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_random_access_file(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), std::shared_ptr<arrow::io::RandomAccessFile> (new arrow::py::PyReadableFile(__pyx_v_handle))); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 631, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "pyarrow/io.pxi":633
 *             self.set_random_access_file(
 *                 shared_ptr[RandomAccessFile](new PyReadableFile(handle)))
 *             self.is_readable = True             # <<<<<<<<<<<<<<
 *         else:
 *             self.set_output_stream(
 */
    __pyx_v_self->__pyx_base.is_readable = 1;

    /* "pyarrow/io.pxi":630
 *             # (other duck-typed file-like objects are possible)
 * 
 *         if kind == 'r':             # <<<<<<<<<<<<<<
 *             self.set_random_access_file(
 *                 shared_ptr[RandomAccessFile](new PyReadableFile(handle)))
 */
    goto __pyx_L37;
  }

  /* "pyarrow/io.pxi":635
 *             self.is_readable = True
 *         else:
 *             self.set_output_stream(             # <<<<<<<<<<<<<<
 *                 shared_ptr[OutputStream](new PyOutputStream(handle)))
 *             self.is_writable = True
 */
  /*else*/ {

    /* "pyarrow/io.pxi":636
 *         else:
 *             self.set_output_stream(
 *                 shared_ptr[OutputStream](new PyOutputStream(handle)))             # <<<<<<<<<<<<<<
 *             self.is_writable = True
 * 
 */
    __pyx_t_8 = ((struct __pyx_vtabstruct_7pyarrow_3lib_PythonFile *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_output_stream(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), std::shared_ptr<arrow::io::OutputStream> (new arrow::py::PyOutputStream(__pyx_v_handle))); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 635, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "pyarrow/io.pxi":637
 *             self.set_output_stream(
 *                 shared_ptr[OutputStream](new PyOutputStream(handle)))
 *             self.is_writable = True             # <<<<<<<<<<<<<<
 * 
 *     def truncate(self, pos=None):
 */
    __pyx_v_self->__pyx_base.is_writable = 1;
  }
  __pyx_L37:;

  /* "pyarrow/io.pxi":585
 *         object handle
 * 
 *     def __cinit__(self, handle, mode=None):             # <<<<<<<<<<<<<<
 *         self.handle = handle
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_AddTraceback("pyarrow.lib.PythonFile.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_inferred_mode);
  __Pyx_XDECREF(__pyx_v_kind);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":639
 *             self.is_writable = True
 * 
 *     def truncate(self, pos=None):             # <<<<<<<<<<<<<<
 *         self.handle.truncate(pos)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10PythonFile_3truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10PythonFile_2truncate[] = "PythonFile.truncate(self, pos=None)";
static PyObject *__pyx_pw_7pyarrow_3lib_10PythonFile_3truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pos = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("truncate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pos,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pos);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "truncate") < 0)) __PYX_ERR(6, 639, __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(6, 639, __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":640
 * 
 *     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(6, 640, __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(6, 640, __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":639
 *             self.is_writable = True
 * 
 *     def truncate(self, pos=None):             # <<<<<<<<<<<<<<
 *         self.handle.truncate(pos)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.PythonFile.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":642
 *         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(6, 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_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(6, 642, __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":643
 * 
 *     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(6, 643, __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(6, 643, __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":642
 *         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":645
 *         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(6, 645, __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(6, 645, __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":646
 * 
 *     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(6, 646, __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(6, 646, __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":645
 *         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__160, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__161, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":660
 * 
 *     @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(6, 660, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(6, 660, __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(6, 660, __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":663
 *         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(6, 663, __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(6, 663, __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(6, 663, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io.pxi":664
 *             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(6, 664, __pyx_L1_error)
  __pyx_v_c_size = __pyx_t_5;

  /* "pyarrow/io.pxi":666
 *             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":667
 * 
 *         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(6, 667, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":666
 *             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":669
 *             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(6, 669, __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":670
 * 
 *         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":671
 *         cdef MemoryMappedFile result = MemoryMappedFile()
 *         result.path = path
 *         result.is_readable = True             # <<<<<<<<<<<<<<
 *         result.is_writable = True
 *         result.set_output_stream(<shared_ptr[OutputStream]> handle)
 */
  __pyx_v_result->__pyx_base.is_readable = 1;

  /* "pyarrow/io.pxi":672
 *         result.path = path
 *         result.is_readable = True
 *         result.is_writable = True             # <<<<<<<<<<<<<<
 *         result.set_output_stream(<shared_ptr[OutputStream]> handle)
 *         result.set_random_access_file(<shared_ptr[RandomAccessFile]> handle)
 */
  __pyx_v_result->__pyx_base.is_writable = 1;

  /* "pyarrow/io.pxi":673
 *         result.is_readable = True
 *         result.is_writable = True
 *         result.set_output_stream(<shared_ptr[OutputStream]> handle)             # <<<<<<<<<<<<<<
 *         result.set_random_access_file(<shared_ptr[RandomAccessFile]> handle)
 *         result.handle = handle
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_MemoryMappedFile *)__pyx_v_result->__pyx_base.__pyx_vtab)->__pyx_base.set_output_stream(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_result), ((std::shared_ptr<arrow::io::OutputStream> )__pyx_v_handle)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 673, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":674
 *         result.is_writable = True
 *         result.set_output_stream(<shared_ptr[OutputStream]> handle)
 *         result.set_random_access_file(<shared_ptr[RandomAccessFile]> handle)             # <<<<<<<<<<<<<<
 *         result.handle = handle
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_MemoryMappedFile *)__pyx_v_result->__pyx_base.__pyx_vtab)->__pyx_base.set_random_access_file(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_result), ((std::shared_ptr<arrow::io::RandomAccessFile> )__pyx_v_handle)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":675
 *         result.set_output_stream(<shared_ptr[OutputStream]> handle)
 *         result.set_random_access_file(<shared_ptr[RandomAccessFile]> handle)
 *         result.handle = handle             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  __pyx_v_result->handle = __pyx_v_handle;

  /* "pyarrow/io.pxi":677
 *         result.handle = handle
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def _open(self, path, mode='r'):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/io.pxi":660
 * 
 *     @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":679
 *         return result
 * 
 *     def _open(self, path, mode='r'):             # <<<<<<<<<<<<<<
 *         self.path = path
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_3_open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16MemoryMappedFile_2_open[] = "MemoryMappedFile._open(self, path, mode=u'r')";
static PyObject *__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_3_open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_mode = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_open (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_mode,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_n_u_r);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_open") < 0)) __PYX_ERR(6, 679, __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(6, 679, __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":680
 * 
 *     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":685
 *             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(6, 685, __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(6, 685, __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(6, 685, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io.pxi":687
 *             c_string c_path = encode_file_path(path)
 * 
 *         if mode in ('r', 'rb'):             # <<<<<<<<<<<<<<
 *             c_mode = FileMode_READ
 *             self.is_readable = True
 */
  __Pyx_INCREF(__pyx_v_mode);
  __pyx_t_1 = __pyx_v_mode;
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_r, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(6, 687, __pyx_L1_error)
  if (!__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_rb_2, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(6, 687, __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":688
 * 
 *         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":689
 *         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":687
 *             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":690
 *             c_mode = FileMode_READ
 *             self.is_readable = True
 *         elif mode in ('w', 'wb'):             # <<<<<<<<<<<<<<
 *             c_mode = FileMode_WRITE
 *             self.is_writable = True
 */
  __Pyx_INCREF(__pyx_v_mode);
  __pyx_t_1 = __pyx_v_mode;
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_w, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(6, 690, __pyx_L1_error)
  if (!__pyx_t_5) {
  } else {
    __pyx_t_6 = __pyx_t_5;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_wb, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(6, 690, __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":691
 *             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":692
 *         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":690
 *             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":693
 *             c_mode = FileMode_WRITE
 *             self.is_writable = True
 *         elif mode in ('r+', 'r+b', 'rb+'):             # <<<<<<<<<<<<<<
 *             c_mode = FileMode_READWRITE
 *             self.is_readable = True
 */
  __Pyx_INCREF(__pyx_v_mode);
  __pyx_t_1 = __pyx_v_mode;
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_r_2, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(6, 693, __pyx_L1_error)
  if (!__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_r_b, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(6, 693, __pyx_L1_error)
  if (!__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_rb, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(6, 693, __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":694
 *             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":695
 *         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":696
 *             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":693
 *             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":698
 *             self.is_writable = True
 *         else:
 *             raise ValueError('Invalid file mode: {0}'.format(mode))             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Invalid_file_mode_0, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_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(6, 698, __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(6, 698, __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(6, 698, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/io.pxi":700
 *             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":701
 * 
 *         with nogil:
 *             check_status(CMemoryMappedFile.Open(c_path, c_mode, &handle))             # <<<<<<<<<<<<<<
 * 
 *         self.set_output_stream(<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(6, 701, __pyx_L12_error)
      }

      /* "pyarrow/io.pxi":700
 *             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":703
 *             check_status(CMemoryMappedFile.Open(c_path, c_mode, &handle))
 * 
 *         self.set_output_stream(<shared_ptr[OutputStream]> handle)             # <<<<<<<<<<<<<<
 *         self.set_random_access_file(<shared_ptr[RandomAccessFile]> handle)
 *         self.handle = handle
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_MemoryMappedFile *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_output_stream(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), ((std::shared_ptr<arrow::io::OutputStream> )__pyx_v_handle)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io.pxi":704
 * 
 *         self.set_output_stream(<shared_ptr[OutputStream]> handle)
 *         self.set_random_access_file(<shared_ptr[RandomAccessFile]> handle)             # <<<<<<<<<<<<<<
 *         self.handle = handle
 * 
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_MemoryMappedFile *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_random_access_file(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), ((std::shared_ptr<arrow::io::RandomAccessFile> )__pyx_v_handle)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io.pxi":705
 *         self.set_output_stream(<shared_ptr[OutputStream]> handle)
 *         self.set_random_access_file(<shared_ptr[RandomAccessFile]> handle)
 *         self.handle = handle             # <<<<<<<<<<<<<<
 * 
 *     def resize(self, new_size):
 */
  __pyx_v_self->handle = __pyx_v_handle;

  /* "pyarrow/io.pxi":679
 *         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":707
 *         self.handle = handle
 * 
 *     def resize(self, new_size):             # <<<<<<<<<<<<<<
 *         """
 *         Resize the map and underlying file.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_5resize(PyObject *__pyx_v_self, PyObject *__pyx_v_new_size); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16MemoryMappedFile_4resize[] = "MemoryMappedFile.resize(self, new_size)\n\n        Resize the map and underlying file.\n\n        Parameters\n        ----------\n        new_size : new size in bytes\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_5resize(PyObject *__pyx_v_self, PyObject *__pyx_v_new_size) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("resize (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16MemoryMappedFile_4resize(((struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *)__pyx_v_self), ((PyObject *)__pyx_v_new_size));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16MemoryMappedFile_4resize(struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *__pyx_v_self, PyObject *__pyx_v_new_size) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int64_t __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("resize", 0);

  /* "pyarrow/io.pxi":715
 *         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(6, 715, __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(6, 715, __pyx_L1_error)

  /* "pyarrow/io.pxi":707
 *         self.handle = handle
 * 
 *     def resize(self, new_size):             # <<<<<<<<<<<<<<
 *         """
 *         Resize the map and underlying file.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.MemoryMappedFile.resize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":717
 *         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":718
 * 
 *     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(6, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 718, __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":719
 *     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(6, 719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":717
 *         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__162, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__163, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":722
 * 
 * 
 * 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_111memory_map(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_110memory_map[] = "memory_map(path, mode=u'r')\n\n    Open memory map at file path. Size of the memory map cannot change\n\n    Parameters\n    ----------\n    path : string\n    mode : {'r', 'r+', 'w'}, default 'r'\n        Whether the file is opened for reading ('r+'), writing ('w')\n        or both ('r+').\n\n    Returns\n    -------\n    mmap : MemoryMappedFile\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_111memory_map = {"memory_map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_111memory_map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_110memory_map};
static PyObject *__pyx_pw_7pyarrow_3lib_111memory_map(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_mode = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("memory_map (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_mode,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_n_u_r);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "memory_map") < 0)) __PYX_ERR(6, 722, __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(6, 722, __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_110memory_map(__pyx_self, __pyx_v_path, __pyx_v_mode);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_110memory_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":737
 *     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(6, 737, __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":738
 *     """
 *     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(6, 738, __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(6, 738, __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(6, 738, __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(6, 738, __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(6, 738, __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":739
 *     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":722
 * 
 * 
 * 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":742
 * 
 * 
 * def create_memory_map(path, size):             # <<<<<<<<<<<<<<
 *     """
 *     Create a file of the given size and memory-map it.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_113create_memory_map(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_112create_memory_map[] = "create_memory_map(path, size)\n\n    Create a file of the given size and memory-map it.\n\n    Parameters\n    ----------\n    path : string\n        The file path to create, on the local filesystem.\n    size : int\n        The file size to create.\n\n    Returns\n    -------\n    mmap : MemoryMappedFile\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_113create_memory_map = {"create_memory_map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_113create_memory_map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_112create_memory_map};
static PyObject *__pyx_pw_7pyarrow_3lib_113create_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(6, 742, __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(6, 742, __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(6, 742, __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_112create_memory_map(__pyx_self, __pyx_v_path, __pyx_v_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_112create_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":757
 *     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(6, 757, __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(6, 757, __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(6, 757, __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(6, 757, __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(6, 757, __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":742
 * 
 * 
 * def create_memory_map(path, size):             # <<<<<<<<<<<<<<
 *     """
 *     Create a file of the given size and memory-map it.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.create_memory_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":767
 *         object path
 * 
 *     def __cinit__(self, path, mode='r', MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         self.path = path
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_6OSFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_6OSFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_mode = 0;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_mode,&__pyx_n_s_memory_pool,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_n_u_r);
    values[2] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(6, 767, __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(6, 767, __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(6, 767, __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":768
 * 
 *     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":773
 *             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(6, 773, __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(6, 773, __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(6, 773, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io.pxi":775
 *             c_string c_path = encode_file_path(path)
 * 
 *         if mode in ('r', 'rb'):             # <<<<<<<<<<<<<<
 *             self._open_readable(c_path, maybe_unbox_memory_pool(memory_pool))
 *         elif mode in ('w', 'wb'):
 */
  __Pyx_INCREF(__pyx_v_mode);
  __pyx_t_1 = __pyx_v_mode;
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_r, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(6, 775, __pyx_L1_error)
  if (!__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_rb_2, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(6, 775, __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":776
 * 
 *         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(6, 776, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/io.pxi":775
 *             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":777
 *         if mode in ('r', 'rb'):
 *             self._open_readable(c_path, maybe_unbox_memory_pool(memory_pool))
 *         elif mode in ('w', 'wb'):             # <<<<<<<<<<<<<<
 *             self._open_writable(c_path)
 *         else:
 */
  __Pyx_INCREF(__pyx_v_mode);
  __pyx_t_1 = __pyx_v_mode;
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_w, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(6, 777, __pyx_L1_error)
  if (!__pyx_t_5) {
  } else {
    __pyx_t_6 = __pyx_t_5;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_wb, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(6, 777, __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":778
 *             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(6, 778, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/io.pxi":777
 *         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":780
 *             self._open_writable(c_path)
 *         else:
 *             raise ValueError('Invalid file mode: {0}'.format(mode))             # <<<<<<<<<<<<<<
 * 
 *     cdef _open_readable(self, c_string path, CMemoryPool* pool):
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Invalid_file_mode_0, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 780, __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(6, 780, __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(6, 780, __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(6, 780, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/io.pxi":767
 *         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":782
 *             raise ValueError('Invalid file mode: {0}'.format(mode))
 * 
 *     cdef _open_readable(self, c_string path, CMemoryPool* pool):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[ReadableFile] handle
 * 
 */

static PyObject *__pyx_f_7pyarrow_3lib_6OSFile__open_readable(struct __pyx_obj_7pyarrow_3lib_OSFile *__pyx_v_self, std::string __pyx_v_path,  arrow::MemoryPool *__pyx_v_pool) {
  std::shared_ptr<arrow::io::ReadableFile>  __pyx_v_handle;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("_open_readable", 0);

  /* "pyarrow/io.pxi":785
 *         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":786
 * 
 *         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(6, 786, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":785
 *         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":788
 *             check_status(ReadableFile.Open(path, pool, &handle))
 * 
 *         self.is_readable = True             # <<<<<<<<<<<<<<
 *         self.set_random_access_file(<shared_ptr[RandomAccessFile]> handle)
 * 
 */
  __pyx_v_self->__pyx_base.is_readable = 1;

  /* "pyarrow/io.pxi":789
 * 
 *         self.is_readable = True
 *         self.set_random_access_file(<shared_ptr[RandomAccessFile]> handle)             # <<<<<<<<<<<<<<
 * 
 *     cdef _open_writable(self, c_string path):
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_OSFile *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_random_access_file(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), ((std::shared_ptr<arrow::io::RandomAccessFile> )__pyx_v_handle)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io.pxi":782
 *             raise ValueError('Invalid file mode: {0}'.format(mode))
 * 
 *     cdef _open_readable(self, c_string path, CMemoryPool* pool):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[ReadableFile] handle
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.OSFile._open_readable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":791
 *         self.set_random_access_file(<shared_ptr[RandomAccessFile]> handle)
 * 
 *     cdef _open_writable(self, c_string path):             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(FileOutputStream.Open(path, &self.output_stream))
 */

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":792
 * 
 *     cdef _open_writable(self, c_string path):
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(FileOutputStream.Open(path, &self.output_stream))
 *         self.is_writable = True
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":793
 *     cdef _open_writable(self, c_string path):
 *         with nogil:
 *             check_status(FileOutputStream.Open(path, &self.output_stream))             # <<<<<<<<<<<<<<
 *         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.output_stream))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 793, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":792
 * 
 *     cdef _open_writable(self, c_string path):
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(FileOutputStream.Open(path, &self.output_stream))
 *         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":794
 *         with nogil:
 *             check_status(FileOutputStream.Open(path, &self.output_stream))
 *         self.is_writable = True             # <<<<<<<<<<<<<<
 * 
 *     def fileno(self):
 */
  __pyx_v_self->__pyx_base.is_writable = 1;

  /* "pyarrow/io.pxi":791
 *         self.set_random_access_file(<shared_ptr[RandomAccessFile]> handle)
 * 
 *     cdef _open_writable(self, c_string path):             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(FileOutputStream.Open(path, &self.output_stream))
 */

  /* 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":796
 *         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":797
 * 
 *     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(6, 797, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 797, __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":798
 *     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(6, 798, __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(6, 798, __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(6, 798, __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":796
 *         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__164, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__165, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":806
 *     """
 * 
 *     def __cinit__(self, Buffer buffer):             # <<<<<<<<<<<<<<
 *         self.output_stream.reset(new CFixedSizeBufferWriter(buffer.buffer))
 *         self.is_writable = True
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_buffer = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_buffer,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(6, 806, __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(6, 806, __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(6, 806, __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":807
 * 
 *     def __cinit__(self, Buffer buffer):
 *         self.output_stream.reset(new CFixedSizeBufferWriter(buffer.buffer))             # <<<<<<<<<<<<<<
 *         self.is_writable = True
 * 
 */
  __pyx_v_self->__pyx_base.output_stream.reset(new  arrow::io::FixedSizeBufferWriter(__pyx_v_buffer->buffer));

  /* "pyarrow/io.pxi":808
 *     def __cinit__(self, Buffer buffer):
 *         self.output_stream.reset(new CFixedSizeBufferWriter(buffer.buffer))
 *         self.is_writable = True             # <<<<<<<<<<<<<<
 * 
 *     def set_memcopy_threads(self, int num_threads):
 */
  __pyx_v_self->__pyx_base.is_writable = 1;

  /* "pyarrow/io.pxi":806
 *     """
 * 
 *     def __cinit__(self, Buffer buffer):             # <<<<<<<<<<<<<<
 *         self.output_stream.reset(new CFixedSizeBufferWriter(buffer.buffer))
 *         self.is_writable = True
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":810
 *         self.is_writable = True
 * 
 *     def set_memcopy_threads(self, int num_threads):             # <<<<<<<<<<<<<<
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_3set_memcopy_threads(PyObject *__pyx_v_self, PyObject *__pyx_arg_num_threads); /*proto*/
static char __pyx_doc_7pyarrow_3lib_21FixedSizeBufferWriter_2set_memcopy_threads[] = "FixedSizeBufferWriter.set_memcopy_threads(self, int num_threads)";
static PyObject *__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_3set_memcopy_threads(PyObject *__pyx_v_self, PyObject *__pyx_arg_num_threads) {
  int __pyx_v_num_threads;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_memcopy_threads (wrapper)", 0);
  assert(__pyx_arg_num_threads); {
    __pyx_v_num_threads = __Pyx_PyInt_As_int(__pyx_arg_num_threads); if (unlikely((__pyx_v_num_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 810, __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":812
 *     def set_memcopy_threads(self, int num_threads):
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()             # <<<<<<<<<<<<<<
 *         writer.set_memcopy_threads(num_threads)
 * 
 */
  __pyx_v_writer = (( arrow::io::FixedSizeBufferWriter *)__pyx_v_self->__pyx_base.output_stream.get());

  /* "pyarrow/io.pxi":813
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()
 *         writer.set_memcopy_threads(num_threads)             # <<<<<<<<<<<<<<
 * 
 *     def set_memcopy_blocksize(self, int64_t blocksize):
 */
  __pyx_v_writer->set_memcopy_threads(__pyx_v_num_threads);

  /* "pyarrow/io.pxi":810
 *         self.is_writable = True
 * 
 *     def set_memcopy_threads(self, int num_threads):             # <<<<<<<<<<<<<<
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":815
 *         writer.set_memcopy_threads(num_threads)
 * 
 *     def set_memcopy_blocksize(self, int64_t blocksize):             # <<<<<<<<<<<<<<
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_5set_memcopy_blocksize(PyObject *__pyx_v_self, PyObject *__pyx_arg_blocksize); /*proto*/
static char __pyx_doc_7pyarrow_3lib_21FixedSizeBufferWriter_4set_memcopy_blocksize[] = "FixedSizeBufferWriter.set_memcopy_blocksize(self, int64_t blocksize)";
static PyObject *__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_5set_memcopy_blocksize(PyObject *__pyx_v_self, PyObject *__pyx_arg_blocksize) {
  int64_t __pyx_v_blocksize;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_memcopy_blocksize (wrapper)", 0);
  assert(__pyx_arg_blocksize); {
    __pyx_v_blocksize = __Pyx_PyInt_As_int64_t(__pyx_arg_blocksize); if (unlikely((__pyx_v_blocksize == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 815, __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":817
 *     def set_memcopy_blocksize(self, int64_t blocksize):
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()             # <<<<<<<<<<<<<<
 *         writer.set_memcopy_blocksize(blocksize)
 * 
 */
  __pyx_v_writer = (( arrow::io::FixedSizeBufferWriter *)__pyx_v_self->__pyx_base.output_stream.get());

  /* "pyarrow/io.pxi":818
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()
 *         writer.set_memcopy_blocksize(blocksize)             # <<<<<<<<<<<<<<
 * 
 *     def set_memcopy_threshold(self, int64_t threshold):
 */
  __pyx_v_writer->set_memcopy_blocksize(__pyx_v_blocksize);

  /* "pyarrow/io.pxi":815
 *         writer.set_memcopy_threads(num_threads)
 * 
 *     def set_memcopy_blocksize(self, int64_t blocksize):             # <<<<<<<<<<<<<<
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":820
 *         writer.set_memcopy_blocksize(blocksize)
 * 
 *     def set_memcopy_threshold(self, int64_t threshold):             # <<<<<<<<<<<<<<
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_7set_memcopy_threshold(PyObject *__pyx_v_self, PyObject *__pyx_arg_threshold); /*proto*/
static char __pyx_doc_7pyarrow_3lib_21FixedSizeBufferWriter_6set_memcopy_threshold[] = "FixedSizeBufferWriter.set_memcopy_threshold(self, int64_t threshold)";
static PyObject *__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_7set_memcopy_threshold(PyObject *__pyx_v_self, PyObject *__pyx_arg_threshold) {
  int64_t __pyx_v_threshold;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_memcopy_threshold (wrapper)", 0);
  assert(__pyx_arg_threshold); {
    __pyx_v_threshold = __Pyx_PyInt_As_int64_t(__pyx_arg_threshold); if (unlikely((__pyx_v_threshold == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 820, __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":822
 *     def set_memcopy_threshold(self, int64_t threshold):
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()             # <<<<<<<<<<<<<<
 *         writer.set_memcopy_threshold(threshold)
 * 
 */
  __pyx_v_writer = (( arrow::io::FixedSizeBufferWriter *)__pyx_v_self->__pyx_base.output_stream.get());

  /* "pyarrow/io.pxi":823
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()
 *         writer.set_memcopy_threshold(threshold)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_writer->set_memcopy_threshold(__pyx_v_threshold);

  /* "pyarrow/io.pxi":820
 *         writer.set_memcopy_blocksize(blocksize)
 * 
 *     def set_memcopy_threshold(self, int64_t threshold):             # <<<<<<<<<<<<<<
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_21FixedSizeBufferWriter_8__reduce_cython__[] = "FixedSizeBufferWriter.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter_8__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__166, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__167, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":838
 *     """
 * 
 *     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":841
 *         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":842
 * 
 *     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__168, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(6, 842, __pyx_L1_error)

  /* "pyarrow/io.pxi":841
 *         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":845
 *                         "`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":846
 * 
 *     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":847
 *     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(6, 847, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 847, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  (__pyx_v_self->shape[0]) = __pyx_t_2;

  /* "pyarrow/io.pxi":848
 *         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":845
 *                         "`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":850
 *         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":851
 * 
 *     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(6, 851, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 851, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":850
 *         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":854
 * 
 *     @property
 *     def size(self):             # <<<<<<<<<<<<<<
 *         """
 *         The buffer size in bytes.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_4size_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_4size___get__(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_4size___get__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/io.pxi":858
 *         The buffer size in bytes.
 *         """
 *         return self.buffer.get().size()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->buffer.get()->size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":854
 * 
 *     @property
 *     def size(self):             # <<<<<<<<<<<<<<
 *         """
 *         The buffer size in bytes.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":861
 * 
 *     @property
 *     def address(self):             # <<<<<<<<<<<<<<
 *         """
 *         The buffer's address, as an integer.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_7address_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_7address_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_7address___get__(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_7address___get__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/io.pxi":865
 *         The buffer's address, as an integer.
 *         """
 *         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(6, 865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":861
 * 
 *     @property
 *     def address(self):             # <<<<<<<<<<<<<<
 *         """
 *         The buffer's address, as an integer.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.address.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":868
 * 
 *     @property
 *     def is_mutable(self):             # <<<<<<<<<<<<<<
 *         """
 *         Whether the buffer is mutable.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_10is_mutable_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_10is_mutable_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_10is_mutable___get__(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_10is_mutable___get__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/io.pxi":872
 *         Whether the buffer is mutable.
 *         """
 *         return self.buffer.get().is_mutable()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->buffer.get()->is_mutable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 872, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":868
 * 
 *     @property
 *     def is_mutable(self):             # <<<<<<<<<<<<<<
 *         """
 *         Whether the buffer is mutable.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.is_mutable.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":875
 * 
 *     @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":876
 *     @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":878
 *         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":879
 * 
 *         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":878
 *         cdef shared_ptr[CBuffer] parent_buf = self.buffer.get().parent()
 * 
 *         if parent_buf.get() == NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         else:
 */
  }

  /* "pyarrow/io.pxi":881
 *             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(6, 881, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/io.pxi":875
 * 
 *     @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":883
 *             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":884
 * 
 *     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":885
 *     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(6, 885, __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(6, 885, __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(6, 885, __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(6, 885, __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(6, 885, __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":884
 * 
 *     def __getitem__(self, key):
 *         if PySlice_Check(key):             # <<<<<<<<<<<<<<
 *             return _normalize_slice(self, key)
 * 
 */
  }

  /* "pyarrow/io.pxi":887
 *             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(6, 887, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 887, __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(6, 887, __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(6, 887, __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(6, 887, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":883
 *             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":889
 *         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":890
 * 
 *     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(6, 890, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":889
 *         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":892
 *         return self.buffer.get().data()[i]
 * 
 *     def slice(self, offset=0, length=None):             # <<<<<<<<<<<<<<
 *         """
 *         Slice this buffer.  Memory is not copied.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_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        Slice this buffer.  Memory is not copied.\n\n        You can also use the Python slice notation ``buffer[start:stop]``.\n\n        Parameters\n        ----------\n        offset : int, default 0\n            Offset from start of buffer to slice\n        length : int, default None\n            Length of slice (default is until end of Buffer starting from\n            offset)\n\n        Returns\n        -------\n        sliced : Buffer\n            A logical view over this buffer.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_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(6, 892, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_offset = values[0];
    __pyx_v_length = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("slice", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 892, __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":913
 *         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(6, 913, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 913, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/io.pxi":914
 * 
 *         if offset < 0:
 *             raise IndexError('Offset must be non-negative')             # <<<<<<<<<<<<<<
 * 
 *         if length is None:
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__116, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 914, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 914, __pyx_L1_error)

    /* "pyarrow/io.pxi":913
 *         cdef shared_ptr[CBuffer] result
 * 
 *         if offset < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError('Offset must be non-negative')
 * 
 */
  }

  /* "pyarrow/io.pxi":916
 *             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":917
 * 
 *         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(6, 917, __pyx_L1_error)
    __pyx_v_result = arrow::SliceBuffer(__pyx_v_self->buffer, __pyx_t_4);

    /* "pyarrow/io.pxi":916
 *             raise IndexError('Offset must be non-negative')
 * 
 *         if length is None:             # <<<<<<<<<<<<<<
 *             result = SliceBuffer(self.buffer, offset)
 *         else:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/io.pxi":919
 *             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(6, 919, __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(6, 919, __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(6, 919, __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(6, 919, __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(6, 919, __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(6, 919, __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":921
 *             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(6, 921, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":892
 *         return self.buffer.get().data()[i]
 * 
 *     def slice(self, offset=0, length=None):             # <<<<<<<<<<<<<<
 *         """
 *         Slice this buffer.  Memory is not copied.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":923
 *         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(6, 923, __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":935
 *         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":936
 *         """
 *         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":937
 *         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":936
 *         """
 *         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":938
 *         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(6, 938, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":923
 *         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":940
 *         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":941
 * 
 *     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":942
 *     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(6, 942, __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(6, 942, __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":941
 * 
 *     def __eq__(self, other):
 *         if isinstance(other, Buffer):             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         else:
 */
  }

  /* "pyarrow/io.pxi":944
 *             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":940
 *         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":946
 *             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":947
 * 
 *     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(6, 947, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 947, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyarrow/io.pxi":948
 *     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(6, 948, __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(6, 948, __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(6, 948, __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(6, 948, __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(6, 948, __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(6, 948, __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":947
 * 
 *     def __reduce_ex__(self, protocol):
 *         if protocol >= 5:             # <<<<<<<<<<<<<<
 *             return py_buffer, (builtin_pickle.PickleBuffer(self),)
 *         else:
 */
  }

  /* "pyarrow/io.pxi":950
 *             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(6, 950, __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(6, 950, __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(6, 950, __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(6, 950, __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(6, 950, __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":946
 *             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":952
 *             return py_buffer, (self.to_pybytes(),)
 * 
 *     def to_pybytes(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this buffer as a Python bytes object.  Memory is copied.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_17to_pybytes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Buffer_16to_pybytes[] = "Buffer.to_pybytes(self)\n\n        Return this buffer as a Python bytes object.  Memory is copied.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_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":956
 *         Return this buffer as a Python bytes object.  Memory is copied.
 *         """
 *         return cp.PyBytes_FromStringAndSize(             # <<<<<<<<<<<<<<
 *             <const char*>self.buffer.get().data(),
 *             self.buffer.get().size())
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/io.pxi":958
 *         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(6, 956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":952
 *             return py_buffer, (self.to_pybytes(),)
 * 
 *     def to_pybytes(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this buffer as a Python bytes object.  Memory is copied.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.to_pybytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":960
 *             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":961
 * 
 *     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":962
 *     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":961
 * 
 *     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":964
 *             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":965
 *         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__169, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 965, __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, 965, __pyx_L1_error)

      /* "pyarrow/io.pxi":964
 *             buffer.readonly = 0
 *         else:
 *             if flags & cp.PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
 *                 raise BufferError("Writable buffer requested but Arrow "
 *                                   "buffer was not mutable")
 */
    }

    /* "pyarrow/io.pxi":967
 *                 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":968
 *                                   "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":969
 *             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":970
 *         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":971
 *         buffer.format = 'b'
 *         buffer.internal = NULL
 *         buffer.itemsize = 1             # <<<<<<<<<<<<<<
 *         buffer.len = self.size
 *         buffer.ndim = 1
 */
  __pyx_v_buffer->itemsize = 1;

  /* "pyarrow/io.pxi":972
 *         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(6, 972, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 972, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_buffer->len = __pyx_t_3;

  /* "pyarrow/io.pxi":973
 *         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":974
 *         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":975
 *         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":976
 *         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":977
 *         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":960
 *             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":979
 *         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":980
 * 
 *     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":981
 *     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(6, 981, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 981, __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":980
 * 
 *     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":982
 *         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":979
 *         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":984
 *         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":985
 * 
 *     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":986
 *     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__170, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 986, __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, 986, __pyx_L1_error)

    /* "pyarrow/io.pxi":985
 * 
 *     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":987
 *         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":988
 *             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":987
 *         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":989
 *         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(6, 989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 989, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":984
 *         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":991
 *         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":992
 * 
 *     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":993
 *     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__171, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 993, __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, 993, __pyx_L1_error)

    /* "pyarrow/io.pxi":992
 * 
 *     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":994
 *         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":995
 *             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__170, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 995, __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, 995, __pyx_L1_error)

    /* "pyarrow/io.pxi":994
 *         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":996
 *         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":997
 *             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":996
 *         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":998
 *         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(6, 998, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 998, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":991
 *         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":1006
 *     """
 * 
 *     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":1007
 * 
 *     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":1006
 *     """
 * 
 *     cdef void init_rz(self, const shared_ptr[CResizableBuffer]& buffer):             # <<<<<<<<<<<<<<
 *         self.init(<shared_ptr[CBuffer]> buffer)
 * 
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/io.pxi":1009
 *         self.init(<shared_ptr[CBuffer]> buffer)
 * 
 *     def resize(self, int64_t new_size, shrink_to_fit=False):             # <<<<<<<<<<<<<<
 *         """
 *         Resize buffer to indicated size.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15ResizableBuffer_1resize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15ResizableBuffer_resize[] = "ResizableBuffer.resize(self, int64_t new_size, shrink_to_fit=False)\n\n        Resize buffer to indicated size.\n\n        Parameters\n        ----------\n        new_size : int\n            New size of buffer (padding may be added internally)\n        shrink_to_fit : boolean, default False\n            If this is true, the buffer is shrunk when new_size is less\n            than the current size.\n            If this is false, the buffer is never shrunk.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_15ResizableBuffer_1resize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int64_t __pyx_v_new_size;
  PyObject *__pyx_v_shrink_to_fit = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("resize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_new_size,&__pyx_n_s_shrink_to_fit,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_new_size)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shrink_to_fit);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "resize") < 0)) __PYX_ERR(6, 1009, __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(6, 1009, __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(6, 1009, __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":1022
 *             If this is false, the buffer is never shrunk.
 *         """
 *         cdef c_bool c_shrink_to_fit = shrink_to_fit             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status((<CResizableBuffer*> self.buffer.get())
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_shrink_to_fit); if (unlikely((__pyx_t_1 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(6, 1022, __pyx_L1_error)
  __pyx_v_c_shrink_to_fit = __pyx_t_1;

  /* "pyarrow/io.pxi":1023
 *         """
 *         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":1024
 *         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(6, 1024, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":1023
 *         """
 *         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":1009
 *         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":1028
 * 
 * 
 * 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":1030
 * 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":1031
 *     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(6, 1031, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":1030
 * 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":1032
 *     with nogil:
 *         check_status(AllocateResizableBuffer(pool, 0, &result))
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1028
 * 
 * 
 * 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":1035
 * 
 * 
 * def allocate_buffer(int64_t size, MemoryPool memory_pool=None,             # <<<<<<<<<<<<<<
 *                     resizable=False):
 *     """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_115allocate_buffer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_114allocate_buffer[] = "allocate_buffer(int64_t size, MemoryPool memory_pool=None, resizable=False)\n\n    Allocate a mutable buffer.\n\n    Parameters\n    ----------\n    size : int\n        Number of bytes to allocate (plus internal padding)\n    memory_pool : MemoryPool, optional\n        The pool to allocate memory from.\n        If not given, the default memory pool is used.\n    resizable : boolean, default False\n        If true, the returned buffer is resizable.\n\n    Returns\n    -------\n    buffer : Buffer or ResizableBuffer\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_115allocate_buffer = {"allocate_buffer", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_115allocate_buffer, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_114allocate_buffer};
static PyObject *__pyx_pw_7pyarrow_3lib_115allocate_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":1036
 * 
 * def allocate_buffer(int64_t size, MemoryPool memory_pool=None,
 *                     resizable=False):             # <<<<<<<<<<<<<<
 *     """
 *     Allocate a mutable buffer.
 */
    values[2] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_resizable);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "allocate_buffer") < 0)) __PYX_ERR(6, 1035, __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(6, 1035, __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(6, 1035, __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(6, 1035, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_114allocate_buffer(__pyx_self, __pyx_v_size, __pyx_v_memory_pool, __pyx_v_resizable);

  /* "pyarrow/io.pxi":1035
 * 
 * 
 * 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_114allocate_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":1057
 *         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":1059
 *         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(6, 1059, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":1060
 * 
 *     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":1061
 *     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(6, 1061, __pyx_L5_error)
        }

        /* "pyarrow/io.pxi":1060
 * 
 *     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":1062
 *         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(6, 1062, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1059
 *         CMemoryPool* cpool = maybe_unbox_memory_pool(memory_pool)
 * 
 *     if resizable:             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(AllocateResizableBuffer(cpool, size, &rz_buffer))
 */
  }

  /* "pyarrow/io.pxi":1064
 *         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":1065
 *     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(6, 1065, __pyx_L8_error)
        }

        /* "pyarrow/io.pxi":1064
 *         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":1066
 *         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(6, 1066, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/io.pxi":1035
 * 
 * 
 * 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":1074
 *         shared_ptr[CResizableBuffer] buffer
 * 
 *     def __cinit__(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         self.buffer = _allocate_buffer(maybe_unbox_memory_pool(memory_pool))
 *         self.output_stream.reset(new CBufferOutputStream(
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_18BufferOutputStream_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_18BufferOutputStream_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_memory_pool,0};
    PyObject* values[1] = {0};
    values[0] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(6, 1074, __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(6, 1074, __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(6, 1074, __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":1075
 * 
 *     def __cinit__(self, MemoryPool memory_pool=None):
 *         self.buffer = _allocate_buffer(maybe_unbox_memory_pool(memory_pool))             # <<<<<<<<<<<<<<
 *         self.output_stream.reset(new CBufferOutputStream(
 *             <shared_ptr[CResizableBuffer]> self.buffer))
 */
  __pyx_v_self->buffer = __pyx_f_7pyarrow_3lib__allocate_buffer(__pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_memory_pool));

  /* "pyarrow/io.pxi":1076
 *     def __cinit__(self, MemoryPool memory_pool=None):
 *         self.buffer = _allocate_buffer(maybe_unbox_memory_pool(memory_pool))
 *         self.output_stream.reset(new CBufferOutputStream(             # <<<<<<<<<<<<<<
 *             <shared_ptr[CResizableBuffer]> self.buffer))
 *         self.is_writable = True
 */
  __pyx_v_self->__pyx_base.output_stream.reset(new  arrow::io::BufferOutputStream(((std::shared_ptr< arrow::ResizableBuffer> )__pyx_v_self->buffer)));

  /* "pyarrow/io.pxi":1078
 *         self.output_stream.reset(new CBufferOutputStream(
 *             <shared_ptr[CResizableBuffer]> self.buffer))
 *         self.is_writable = True             # <<<<<<<<<<<<<<
 * 
 *     def getvalue(self):
 */
  __pyx_v_self->__pyx_base.is_writable = 1;

  /* "pyarrow/io.pxi":1074
 *         shared_ptr[CResizableBuffer] buffer
 * 
 *     def __cinit__(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         self.buffer = _allocate_buffer(maybe_unbox_memory_pool(memory_pool))
 *         self.output_stream.reset(new CBufferOutputStream(
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1080
 *         self.is_writable = True
 * 
 *     def getvalue(self):             # <<<<<<<<<<<<<<
 *         """
 *         Finalize output stream and return result as pyarrow.Buffer.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18BufferOutputStream_3getvalue(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18BufferOutputStream_2getvalue[] = "BufferOutputStream.getvalue(self)\n\n        Finalize output stream and return result as pyarrow.Buffer.\n\n        Returns\n        -------\n        value : Buffer\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_18BufferOutputStream_3getvalue(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getvalue (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18BufferOutputStream_2getvalue(((struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18BufferOutputStream_2getvalue(struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("getvalue", 0);

  /* "pyarrow/io.pxi":1088
 *         value : Buffer
 *         """
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.output_stream.get().Close())
 *         return pyarrow_wrap_buffer(<shared_ptr[CBuffer]> self.buffer)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":1089
 *         """
 *         with nogil:
 *             check_status(self.output_stream.get().Close())             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_buffer(<shared_ptr[CBuffer]> self.buffer)
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->__pyx_base.output_stream.get()->Close()); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 1089, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":1088
 *         value : Buffer
 *         """
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.output_stream.get().Close())
 *         return pyarrow_wrap_buffer(<shared_ptr[CBuffer]> self.buffer)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io.pxi":1090
 *         with nogil:
 *             check_status(self.output_stream.get().Close())
 *         return pyarrow_wrap_buffer(<shared_ptr[CBuffer]> self.buffer)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(((std::shared_ptr< arrow::Buffer> )__pyx_v_self->buffer)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1090, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1080
 *         self.is_writable = True
 * 
 *     def getvalue(self):             # <<<<<<<<<<<<<<
 *         """
 *         Finalize output stream and return result as pyarrow.Buffer.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.BufferOutputStream.getvalue", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18BufferOutputStream_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18BufferOutputStream_4__reduce_cython__[] = "BufferOutputStream.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_18BufferOutputStream_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18BufferOutputStream_4__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18BufferOutputStream_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__172, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__173, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":1095
 * cdef class MockOutputStream(NativeFile):
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.output_stream.reset(new CMockOutputStream())
 *         self.is_writable = True
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_16MockOutputStream_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_16MockOutputStream_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16MockOutputStream___cinit__(((struct __pyx_obj_7pyarrow_3lib_MockOutputStream *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_16MockOutputStream___cinit__(struct __pyx_obj_7pyarrow_3lib_MockOutputStream *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/io.pxi":1096
 * 
 *     def __cinit__(self):
 *         self.output_stream.reset(new CMockOutputStream())             # <<<<<<<<<<<<<<
 *         self.is_writable = True
 * 
 */
  __pyx_v_self->__pyx_base.output_stream.reset(new  arrow::io::MockOutputStream());

  /* "pyarrow/io.pxi":1097
 *     def __cinit__(self):
 *         self.output_stream.reset(new CMockOutputStream())
 *         self.is_writable = True             # <<<<<<<<<<<<<<
 * 
 *     def size(self):
 */
  __pyx_v_self->__pyx_base.is_writable = 1;

  /* "pyarrow/io.pxi":1095
 * cdef class MockOutputStream(NativeFile):
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.output_stream.reset(new CMockOutputStream())
 *         self.is_writable = True
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1099
 *         self.is_writable = True
 * 
 *     def size(self):             # <<<<<<<<<<<<<<
 *         handle = <CMockOutputStream*> self.output_stream.get()
 *         return handle.GetExtentBytesWritten()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16MockOutputStream_3size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16MockOutputStream_2size[] = "MockOutputStream.size(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_16MockOutputStream_3size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("size (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16MockOutputStream_2size(((struct __pyx_obj_7pyarrow_3lib_MockOutputStream *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16MockOutputStream_2size(struct __pyx_obj_7pyarrow_3lib_MockOutputStream *__pyx_v_self) {
   arrow::io::MockOutputStream *__pyx_v_handle;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("size", 0);

  /* "pyarrow/io.pxi":1100
 * 
 *     def size(self):
 *         handle = <CMockOutputStream*> self.output_stream.get()             # <<<<<<<<<<<<<<
 *         return handle.GetExtentBytesWritten()
 * 
 */
  __pyx_v_handle = (( arrow::io::MockOutputStream *)__pyx_v_self->__pyx_base.output_stream.get());

  /* "pyarrow/io.pxi":1101
 *     def size(self):
 *         handle = <CMockOutputStream*> self.output_stream.get()
 *         return handle.GetExtentBytesWritten()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_handle->GetExtentBytesWritten()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1099
 *         self.is_writable = True
 * 
 *     def size(self):             # <<<<<<<<<<<<<<
 *         handle = <CMockOutputStream*> self.output_stream.get()
 *         return handle.GetExtentBytesWritten()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.MockOutputStream.size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16MockOutputStream_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16MockOutputStream_4__reduce_cython__[] = "MockOutputStream.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_16MockOutputStream_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16MockOutputStream_4__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_MockOutputStream *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16MockOutputStream_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MockOutputStream *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__174, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__175, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":1115
 *         Buffer buffer
 * 
 *     def __cinit__(self, object obj):             # <<<<<<<<<<<<<<
 *         self.buffer = as_buffer(obj)
 *         self.set_random_access_file(shared_ptr[RandomAccessFile](
 */

/* 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(6, 1115, __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(6, 1115, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.BufferReader.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_12BufferReader___cinit__(((struct __pyx_obj_7pyarrow_3lib_BufferReader *)__pyx_v_self), __pyx_v_obj);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_12BufferReader___cinit__(struct __pyx_obj_7pyarrow_3lib_BufferReader *__pyx_v_self, PyObject *__pyx_v_obj) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/io.pxi":1116
 * 
 *     def __cinit__(self, object obj):
 *         self.buffer = as_buffer(obj)             # <<<<<<<<<<<<<<
 *         self.set_random_access_file(shared_ptr[RandomAccessFile](
 *             new CBufferReader(self.buffer.buffer)))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_as_buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_obj);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1116, __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(6, 1116, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->buffer);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->buffer));
  __pyx_v_self->buffer = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":1117
 *     def __cinit__(self, object obj):
 *         self.buffer = as_buffer(obj)
 *         self.set_random_access_file(shared_ptr[RandomAccessFile](             # <<<<<<<<<<<<<<
 *             new CBufferReader(self.buffer.buffer)))
 *         self.is_readable = True
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_BufferReader *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_random_access_file(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), std::shared_ptr<arrow::io::RandomAccessFile> (new  arrow::io::BufferReader(__pyx_v_self->buffer->buffer))); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":1119
 *         self.set_random_access_file(shared_ptr[RandomAccessFile](
 *             new CBufferReader(self.buffer.buffer)))
 *         self.is_readable = True             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx_base.is_readable = 1;

  /* "pyarrow/io.pxi":1115
 *         Buffer buffer
 * 
 *     def __cinit__(self, object obj):             # <<<<<<<<<<<<<<
 *         self.buffer = as_buffer(obj)
 *         self.set_random_access_file(shared_ptr[RandomAccessFile](
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.BufferReader.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12BufferReader_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12BufferReader_2__reduce_cython__[] = "BufferReader.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_12BufferReader_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12BufferReader_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_BufferReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12BufferReader_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__176, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__177, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":1133
 *         or "zstd")
 *     """
 *     def __init__(self, NativeFile stream, compression):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CompressionType compression_type
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_21CompressedInputStream_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_21CompressedInputStream_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream = 0;
  PyObject *__pyx_v_compression = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stream,&__pyx_n_s_compression,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_compression)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(6, 1133, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(6, 1133, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)values[0]);
    __pyx_v_compression = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1133, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.CompressedInputStream.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_stream), __pyx_ptype_7pyarrow_3lib_NativeFile, 1, "stream", 0))) __PYX_ERR(6, 1133, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_21CompressedInputStream___init__(((struct __pyx_obj_7pyarrow_3lib_CompressedInputStream *)__pyx_v_self), __pyx_v_stream, __pyx_v_compression);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_21CompressedInputStream___init__(struct __pyx_obj_7pyarrow_3lib_CompressedInputStream *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream, PyObject *__pyx_v_compression) {
  enum  arrow::Compression::type __pyx_v_compression_type;
  std::unique_ptr< arrow::util::Codec>  __pyx_v_codec;
  std::shared_ptr< arrow::io::CompressedInputStream>  __pyx_v_compressed_stream;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  enum  arrow::Compression::type __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  std::shared_ptr<arrow::io::InputStream>  __pyx_t_7;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/io.pxi":1139
 *             shared_ptr[CCompressedInputStream] compressed_stream
 * 
 *         compression_type = _get_compression_type(compression)             # <<<<<<<<<<<<<<
 *         if compression_type == CompressionType_UNCOMPRESSED:
 *             raise ValueError('Invalid value for compression: {!r}'
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__get_compression_type(__pyx_v_compression); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 1139, __pyx_L1_error)
  __pyx_v_compression_type = __pyx_t_1;

  /* "pyarrow/io.pxi":1140
 * 
 *         compression_type = _get_compression_type(compression)
 *         if compression_type == CompressionType_UNCOMPRESSED:             # <<<<<<<<<<<<<<
 *             raise ValueError('Invalid value for compression: {!r}'
 *                              .format(compression))
 */
  __pyx_t_2 = ((__pyx_v_compression_type ==  arrow::Compression::UNCOMPRESSED) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/io.pxi":1142
 *         if compression_type == CompressionType_UNCOMPRESSED:
 *             raise ValueError('Invalid value for compression: {!r}'
 *                              .format(compression))             # <<<<<<<<<<<<<<
 * 
 *         check_status(CCodec.Create(compression_type, &codec))
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Invalid_value_for_compression_r, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_compression) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_compression);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/io.pxi":1141
 *         compression_type = _get_compression_type(compression)
 *         if compression_type == CompressionType_UNCOMPRESSED:
 *             raise ValueError('Invalid value for compression: {!r}'             # <<<<<<<<<<<<<<
 *                              .format(compression))
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1141, __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(6, 1141, __pyx_L1_error)

    /* "pyarrow/io.pxi":1140
 * 
 *         compression_type = _get_compression_type(compression)
 *         if compression_type == CompressionType_UNCOMPRESSED:             # <<<<<<<<<<<<<<
 *             raise ValueError('Invalid value for compression: {!r}'
 *                              .format(compression))
 */
  }

  /* "pyarrow/io.pxi":1144
 *                              .format(compression))
 * 
 *         check_status(CCodec.Create(compression_type, &codec))             # <<<<<<<<<<<<<<
 *         check_status(CCompressedInputStream.Make(
 *             codec.get(), stream.get_input_stream(), &compressed_stream))
 */
  __pyx_t_6 = __pyx_f_7pyarrow_3lib_check_status( arrow::util::Codec::Create(__pyx_v_compression_type, (&__pyx_v_codec))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(6, 1144, __pyx_L1_error)

  /* "pyarrow/io.pxi":1146
 *         check_status(CCodec.Create(compression_type, &codec))
 *         check_status(CCompressedInputStream.Make(
 *             codec.get(), stream.get_input_stream(), &compressed_stream))             # <<<<<<<<<<<<<<
 * 
 *         self.set_input_stream(<shared_ptr[InputStream]> compressed_stream)
 */
  __pyx_t_7 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_stream->__pyx_vtab)->get_input_stream(__pyx_v_stream); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 1146, __pyx_L1_error)

  /* "pyarrow/io.pxi":1145
 * 
 *         check_status(CCodec.Create(compression_type, &codec))
 *         check_status(CCompressedInputStream.Make(             # <<<<<<<<<<<<<<
 *             codec.get(), stream.get_input_stream(), &compressed_stream))
 * 
 */
  __pyx_t_6 = __pyx_f_7pyarrow_3lib_check_status( arrow::io::CompressedInputStream::Make(__pyx_v_codec.get(), __pyx_t_7, (&__pyx_v_compressed_stream))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(6, 1145, __pyx_L1_error)

  /* "pyarrow/io.pxi":1148
 *             codec.get(), stream.get_input_stream(), &compressed_stream))
 * 
 *         self.set_input_stream(<shared_ptr[InputStream]> compressed_stream)             # <<<<<<<<<<<<<<
 *         self.is_readable = True
 * 
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_7pyarrow_3lib_CompressedInputStream *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_input_stream(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), ((std::shared_ptr<arrow::io::InputStream> )__pyx_v_compressed_stream)); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/io.pxi":1149
 * 
 *         self.set_input_stream(<shared_ptr[InputStream]> compressed_stream)
 *         self.is_readable = True             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx_base.is_readable = 1;

  /* "pyarrow/io.pxi":1133
 *         or "zstd")
 *     """
 *     def __init__(self, NativeFile stream, compression):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CompressionType compression_type
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.CompressedInputStream.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_21CompressedInputStream_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_21CompressedInputStream_2__reduce_cython__[] = "CompressedInputStream.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_21CompressedInputStream_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_21CompressedInputStream_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_CompressedInputStream *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_21CompressedInputStream_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_CompressedInputStream *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__178, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.CompressedInputStream.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_21CompressedInputStream_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_21CompressedInputStream_4__setstate_cython__[] = "CompressedInputStream.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_21CompressedInputStream_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_21CompressedInputStream_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_CompressedInputStream *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_21CompressedInputStream_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_CompressedInputStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__179, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.CompressedInputStream.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1164
 *     """
 * 
 *     def __init__(self, NativeFile stream, compression):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CompressionType compression_type
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_22CompressedOutputStream_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_22CompressedOutputStream_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream = 0;
  PyObject *__pyx_v_compression = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stream,&__pyx_n_s_compression,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_compression)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(6, 1164, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(6, 1164, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)values[0]);
    __pyx_v_compression = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1164, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.CompressedOutputStream.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_stream), __pyx_ptype_7pyarrow_3lib_NativeFile, 1, "stream", 0))) __PYX_ERR(6, 1164, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_22CompressedOutputStream___init__(((struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream *)__pyx_v_self), __pyx_v_stream, __pyx_v_compression);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_22CompressedOutputStream___init__(struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream, PyObject *__pyx_v_compression) {
  enum  arrow::Compression::type __pyx_v_compression_type;
  std::unique_ptr< arrow::util::Codec>  __pyx_v_codec;
  std::shared_ptr< arrow::io::CompressedOutputStream>  __pyx_v_compressed_stream;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  enum  arrow::Compression::type __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  std::shared_ptr<arrow::io::OutputStream>  __pyx_t_7;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/io.pxi":1170
 *             shared_ptr[CCompressedOutputStream] compressed_stream
 * 
 *         compression_type = _get_compression_type(compression)             # <<<<<<<<<<<<<<
 *         if compression_type == CompressionType_UNCOMPRESSED:
 *             raise ValueError('Invalid value for compression: {!r}'
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__get_compression_type(__pyx_v_compression); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 1170, __pyx_L1_error)
  __pyx_v_compression_type = __pyx_t_1;

  /* "pyarrow/io.pxi":1171
 * 
 *         compression_type = _get_compression_type(compression)
 *         if compression_type == CompressionType_UNCOMPRESSED:             # <<<<<<<<<<<<<<
 *             raise ValueError('Invalid value for compression: {!r}'
 *                              .format(compression))
 */
  __pyx_t_2 = ((__pyx_v_compression_type ==  arrow::Compression::UNCOMPRESSED) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/io.pxi":1173
 *         if compression_type == CompressionType_UNCOMPRESSED:
 *             raise ValueError('Invalid value for compression: {!r}'
 *                              .format(compression))             # <<<<<<<<<<<<<<
 * 
 *         check_status(CCodec.Create(compression_type, &codec))
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Invalid_value_for_compression_r, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1173, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_compression) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_compression);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1173, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/io.pxi":1172
 *         compression_type = _get_compression_type(compression)
 *         if compression_type == CompressionType_UNCOMPRESSED:
 *             raise ValueError('Invalid value for compression: {!r}'             # <<<<<<<<<<<<<<
 *                              .format(compression))
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1172, __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(6, 1172, __pyx_L1_error)

    /* "pyarrow/io.pxi":1171
 * 
 *         compression_type = _get_compression_type(compression)
 *         if compression_type == CompressionType_UNCOMPRESSED:             # <<<<<<<<<<<<<<
 *             raise ValueError('Invalid value for compression: {!r}'
 *                              .format(compression))
 */
  }

  /* "pyarrow/io.pxi":1175
 *                              .format(compression))
 * 
 *         check_status(CCodec.Create(compression_type, &codec))             # <<<<<<<<<<<<<<
 *         check_status(CCompressedOutputStream.Make(
 *             codec.get(), stream.get_output_stream(), &compressed_stream))
 */
  __pyx_t_6 = __pyx_f_7pyarrow_3lib_check_status( arrow::util::Codec::Create(__pyx_v_compression_type, (&__pyx_v_codec))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(6, 1175, __pyx_L1_error)

  /* "pyarrow/io.pxi":1177
 *         check_status(CCodec.Create(compression_type, &codec))
 *         check_status(CCompressedOutputStream.Make(
 *             codec.get(), stream.get_output_stream(), &compressed_stream))             # <<<<<<<<<<<<<<
 * 
 *         self.set_output_stream(<shared_ptr[OutputStream]> compressed_stream)
 */
  __pyx_t_7 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_stream->__pyx_vtab)->get_output_stream(__pyx_v_stream); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 1177, __pyx_L1_error)

  /* "pyarrow/io.pxi":1176
 * 
 *         check_status(CCodec.Create(compression_type, &codec))
 *         check_status(CCompressedOutputStream.Make(             # <<<<<<<<<<<<<<
 *             codec.get(), stream.get_output_stream(), &compressed_stream))
 * 
 */
  __pyx_t_6 = __pyx_f_7pyarrow_3lib_check_status( arrow::io::CompressedOutputStream::Make(__pyx_v_codec.get(), __pyx_t_7, (&__pyx_v_compressed_stream))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(6, 1176, __pyx_L1_error)

  /* "pyarrow/io.pxi":1179
 *             codec.get(), stream.get_output_stream(), &compressed_stream))
 * 
 *         self.set_output_stream(<shared_ptr[OutputStream]> compressed_stream)             # <<<<<<<<<<<<<<
 *         self.is_writable = True
 * 
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_7pyarrow_3lib_CompressedOutputStream *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_output_stream(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), ((std::shared_ptr<arrow::io::OutputStream> )__pyx_v_compressed_stream)); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/io.pxi":1180
 * 
 *         self.set_output_stream(<shared_ptr[OutputStream]> compressed_stream)
 *         self.is_writable = True             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx_base.is_writable = 1;

  /* "pyarrow/io.pxi":1164
 *     """
 * 
 *     def __init__(self, NativeFile stream, compression):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CompressionType compression_type
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.CompressedOutputStream.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_22CompressedOutputStream_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_22CompressedOutputStream_2__reduce_cython__[] = "CompressedOutputStream.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_22CompressedOutputStream_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_22CompressedOutputStream_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_22CompressedOutputStream_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__180, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.CompressedOutputStream.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_22CompressedOutputStream_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_22CompressedOutputStream_4__setstate_cython__[] = "CompressedOutputStream.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_22CompressedOutputStream_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_22CompressedOutputStream_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_22CompressedOutputStream_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__181, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.CompressedOutputStream.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1185
 * cdef class BufferedInputStream(NativeFile):
 * 
 *     def __init__(self, NativeFile stream, int buffer_size,             # <<<<<<<<<<<<<<
 *                  MemoryPool memory_pool=None):
 *         cdef shared_ptr[CBufferedInputStream] buffered_stream
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_19BufferedInputStream_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_19BufferedInputStream_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream = 0;
  int __pyx_v_buffer_size;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stream,&__pyx_n_s_buffer_size,&__pyx_n_s_memory_pool,0};
    PyObject* values[3] = {0,0,0};

    /* "pyarrow/io.pxi":1186
 * 
 *     def __init__(self, NativeFile stream, int buffer_size,
 *                  MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CBufferedInputStream] buffered_stream
 * 
 */
    values[2] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer_size)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(6, 1185, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(6, 1185, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)values[0]);
    __pyx_v_buffer_size = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_buffer_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 1185, __pyx_L3_error)
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1185, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.BufferedInputStream.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_stream), __pyx_ptype_7pyarrow_3lib_NativeFile, 1, "stream", 0))) __PYX_ERR(6, 1185, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(6, 1186, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_19BufferedInputStream___init__(((struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *)__pyx_v_self), __pyx_v_stream, __pyx_v_buffer_size, __pyx_v_memory_pool);

  /* "pyarrow/io.pxi":1185
 * cdef class BufferedInputStream(NativeFile):
 * 
 *     def __init__(self, NativeFile stream, int buffer_size,             # <<<<<<<<<<<<<<
 *                  MemoryPool memory_pool=None):
 *         cdef shared_ptr[CBufferedInputStream] buffered_stream
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_19BufferedInputStream___init__(struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream, int __pyx_v_buffer_size, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
  std::shared_ptr< arrow::io::BufferedInputStream>  __pyx_v_buffered_stream;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  std::shared_ptr<arrow::io::InputStream>  __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/io.pxi":1189
 *         cdef shared_ptr[CBufferedInputStream] buffered_stream
 * 
 *         if buffer_size <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Buffer size must be larger than zero')
 *         check_status(CBufferedInputStream.Create(
 */
  __pyx_t_1 = ((__pyx_v_buffer_size <= 0) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/io.pxi":1190
 * 
 *         if buffer_size <= 0:
 *             raise ValueError('Buffer size must be larger than zero')             # <<<<<<<<<<<<<<
 *         check_status(CBufferedInputStream.Create(
 *             buffer_size, maybe_unbox_memory_pool(memory_pool),
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__182, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1190, __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, 1190, __pyx_L1_error)

    /* "pyarrow/io.pxi":1189
 *         cdef shared_ptr[CBufferedInputStream] buffered_stream
 * 
 *         if buffer_size <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Buffer size must be larger than zero')
 *         check_status(CBufferedInputStream.Create(
 */
  }

  /* "pyarrow/io.pxi":1193
 *         check_status(CBufferedInputStream.Create(
 *             buffer_size, maybe_unbox_memory_pool(memory_pool),
 *             stream.get_input_stream(), &buffered_stream))             # <<<<<<<<<<<<<<
 * 
 *         self.set_input_stream(<shared_ptr[InputStream]> buffered_stream)
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_stream->__pyx_vtab)->get_input_stream(__pyx_v_stream); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 1193, __pyx_L1_error)

  /* "pyarrow/io.pxi":1191
 *         if buffer_size <= 0:
 *             raise ValueError('Buffer size must be larger than zero')
 *         check_status(CBufferedInputStream.Create(             # <<<<<<<<<<<<<<
 *             buffer_size, maybe_unbox_memory_pool(memory_pool),
 *             stream.get_input_stream(), &buffered_stream))
 */
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_check_status( arrow::io::BufferedInputStream::Create(__pyx_v_buffer_size, __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_memory_pool), __pyx_t_3, (&__pyx_v_buffered_stream))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(6, 1191, __pyx_L1_error)

  /* "pyarrow/io.pxi":1195
 *             stream.get_input_stream(), &buffered_stream))
 * 
 *         self.set_input_stream(<shared_ptr[InputStream]> buffered_stream)             # <<<<<<<<<<<<<<
 *         self.is_readable = True
 * 
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_BufferedInputStream *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_input_stream(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), ((std::shared_ptr<arrow::io::InputStream> )__pyx_v_buffered_stream)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io.pxi":1196
 * 
 *         self.set_input_stream(<shared_ptr[InputStream]> buffered_stream)
 *         self.is_readable = True             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx_base.is_readable = 1;

  /* "pyarrow/io.pxi":1185
 * cdef class BufferedInputStream(NativeFile):
 * 
 *     def __init__(self, NativeFile stream, int buffer_size,             # <<<<<<<<<<<<<<
 *                  MemoryPool memory_pool=None):
 *         cdef shared_ptr[CBufferedInputStream] buffered_stream
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.BufferedInputStream.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19BufferedInputStream_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19BufferedInputStream_2__reduce_cython__[] = "BufferedInputStream.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_19BufferedInputStream_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_19BufferedInputStream_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19BufferedInputStream_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__183, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BufferedInputStream.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19BufferedInputStream_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19BufferedInputStream_4__setstate_cython__[] = "BufferedInputStream.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_19BufferedInputStream_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_19BufferedInputStream_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19BufferedInputStream_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__184, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BufferedInputStream.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1201
 * cdef class BufferedOutputStream(NativeFile):
 * 
 *     def __init__(self, NativeFile stream, int buffer_size,             # <<<<<<<<<<<<<<
 *                  MemoryPool memory_pool=None):
 *         cdef shared_ptr[CBufferedOutputStream] buffered_stream
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_20BufferedOutputStream_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_20BufferedOutputStream_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream = 0;
  int __pyx_v_buffer_size;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stream,&__pyx_n_s_buffer_size,&__pyx_n_s_memory_pool,0};
    PyObject* values[3] = {0,0,0};

    /* "pyarrow/io.pxi":1202
 * 
 *     def __init__(self, NativeFile stream, int buffer_size,
 *                  MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CBufferedOutputStream] buffered_stream
 * 
 */
    values[2] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer_size)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(6, 1201, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(6, 1201, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)values[0]);
    __pyx_v_buffer_size = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_buffer_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 1201, __pyx_L3_error)
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1201, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.BufferedOutputStream.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_stream), __pyx_ptype_7pyarrow_3lib_NativeFile, 1, "stream", 0))) __PYX_ERR(6, 1201, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(6, 1202, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_20BufferedOutputStream___init__(((struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *)__pyx_v_self), __pyx_v_stream, __pyx_v_buffer_size, __pyx_v_memory_pool);

  /* "pyarrow/io.pxi":1201
 * cdef class BufferedOutputStream(NativeFile):
 * 
 *     def __init__(self, NativeFile stream, int buffer_size,             # <<<<<<<<<<<<<<
 *                  MemoryPool memory_pool=None):
 *         cdef shared_ptr[CBufferedOutputStream] buffered_stream
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_20BufferedOutputStream___init__(struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream, int __pyx_v_buffer_size, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
  std::shared_ptr< arrow::io::BufferedOutputStream>  __pyx_v_buffered_stream;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  std::shared_ptr<arrow::io::OutputStream>  __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/io.pxi":1205
 *         cdef shared_ptr[CBufferedOutputStream] buffered_stream
 * 
 *         if buffer_size <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Buffer size must be larger than zero')
 *         check_status(CBufferedOutputStream.Create(
 */
  __pyx_t_1 = ((__pyx_v_buffer_size <= 0) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/io.pxi":1206
 * 
 *         if buffer_size <= 0:
 *             raise ValueError('Buffer size must be larger than zero')             # <<<<<<<<<<<<<<
 *         check_status(CBufferedOutputStream.Create(
 *             buffer_size, maybe_unbox_memory_pool(memory_pool),
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__182, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1206, __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, 1206, __pyx_L1_error)

    /* "pyarrow/io.pxi":1205
 *         cdef shared_ptr[CBufferedOutputStream] buffered_stream
 * 
 *         if buffer_size <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Buffer size must be larger than zero')
 *         check_status(CBufferedOutputStream.Create(
 */
  }

  /* "pyarrow/io.pxi":1209
 *         check_status(CBufferedOutputStream.Create(
 *             buffer_size, maybe_unbox_memory_pool(memory_pool),
 *             stream.get_output_stream(), &buffered_stream))             # <<<<<<<<<<<<<<
 * 
 *         self.set_output_stream(<shared_ptr[OutputStream]> buffered_stream)
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_stream->__pyx_vtab)->get_output_stream(__pyx_v_stream); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 1209, __pyx_L1_error)

  /* "pyarrow/io.pxi":1207
 *         if buffer_size <= 0:
 *             raise ValueError('Buffer size must be larger than zero')
 *         check_status(CBufferedOutputStream.Create(             # <<<<<<<<<<<<<<
 *             buffer_size, maybe_unbox_memory_pool(memory_pool),
 *             stream.get_output_stream(), &buffered_stream))
 */
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_check_status( arrow::io::BufferedOutputStream::Create(__pyx_v_buffer_size, __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_memory_pool), __pyx_t_3, (&__pyx_v_buffered_stream))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(6, 1207, __pyx_L1_error)

  /* "pyarrow/io.pxi":1211
 *             stream.get_output_stream(), &buffered_stream))
 * 
 *         self.set_output_stream(<shared_ptr[OutputStream]> buffered_stream)             # <<<<<<<<<<<<<<
 *         self.is_writable = True
 * 
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_BufferedOutputStream *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_output_stream(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), ((std::shared_ptr<arrow::io::OutputStream> )__pyx_v_buffered_stream)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io.pxi":1212
 * 
 *         self.set_output_stream(<shared_ptr[OutputStream]> buffered_stream)
 *         self.is_writable = True             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx_base.is_writable = 1;

  /* "pyarrow/io.pxi":1201
 * cdef class BufferedOutputStream(NativeFile):
 * 
 *     def __init__(self, NativeFile stream, int buffer_size,             # <<<<<<<<<<<<<<
 *                  MemoryPool memory_pool=None):
 *         cdef shared_ptr[CBufferedOutputStream] buffered_stream
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.BufferedOutputStream.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20BufferedOutputStream_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20BufferedOutputStream_2__reduce_cython__[] = "BufferedOutputStream.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_20BufferedOutputStream_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_20BufferedOutputStream_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20BufferedOutputStream_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__185, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BufferedOutputStream.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20BufferedOutputStream_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20BufferedOutputStream_4__setstate_cython__[] = "BufferedOutputStream.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_20BufferedOutputStream_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_20BufferedOutputStream_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20BufferedOutputStream_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__186, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BufferedOutputStream.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1215
 * 
 * 
 * def py_buffer(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Construct an Arrow buffer from a Python bytes-like or buffer-like object
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_117py_buffer(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_116py_buffer[] = "py_buffer(obj)\n\n    Construct an Arrow buffer from a Python bytes-like or buffer-like object\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_117py_buffer = {"py_buffer", (PyCFunction)__pyx_pw_7pyarrow_3lib_117py_buffer, METH_O, __pyx_doc_7pyarrow_3lib_116py_buffer};
static PyObject *__pyx_pw_7pyarrow_3lib_117py_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_116py_buffer(__pyx_self, ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_116py_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":1220
 *     """
 *     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(6, 1220, __pyx_L1_error)

  /* "pyarrow/io.pxi":1221
 *     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(6, 1221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1215
 * 
 * 
 * def py_buffer(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Construct an Arrow buffer from a Python bytes-like or buffer-like object
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.py_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1224
 * 
 * 
 * def foreign_buffer(address, size, base=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct an Arrow buffer with the given *address* and *size*,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_119foreign_buffer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_118foreign_buffer[] = "foreign_buffer(address, size, base=None)\n\n    Construct an Arrow buffer with the given *address* and *size*,\n    optionally backed by the Python *base* object.\n\n    The *base* object, if given, will be kept alive as long as this buffer\n    is alive, including accross language boundaries (for example if the\n    buffer is referenced by C++ code).\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_119foreign_buffer = {"foreign_buffer", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_119foreign_buffer, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_118foreign_buffer};
static PyObject *__pyx_pw_7pyarrow_3lib_119foreign_buffer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_address = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_base = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("foreign_buffer (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_address,&__pyx_n_s_size,&__pyx_n_s_base,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_address)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("foreign_buffer", 0, 2, 3, 1); __PYX_ERR(6, 1224, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_base);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "foreign_buffer") < 0)) __PYX_ERR(6, 1224, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_address = values[0];
    __pyx_v_size = values[1];
    __pyx_v_base = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("foreign_buffer", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1224, __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_118foreign_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_118foreign_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":1234
 *     """
 *     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(6, 1234, __pyx_L1_error)
  __pyx_v_c_addr = __pyx_t_1;

  /* "pyarrow/io.pxi":1235
 *     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(6, 1235, __pyx_L1_error)
  __pyx_v_c_size = __pyx_t_2;

  /* "pyarrow/io.pxi":1238
 *         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(6, 1238, __pyx_L1_error)

  /* "pyarrow/io.pxi":1240
 *     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(6, 1240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1224
 * 
 * 
 * def foreign_buffer(address, size, base=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct an Arrow buffer with the given *address* and *size*,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.foreign_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1243
 * 
 * 
 * def as_buffer(object o):             # <<<<<<<<<<<<<<
 *     if isinstance(o, Buffer):
 *         return o
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_121as_buffer(PyObject *__pyx_self, PyObject *__pyx_v_o); /*proto*/
static char __pyx_doc_7pyarrow_3lib_120as_buffer[] = "as_buffer(o)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_121as_buffer = {"as_buffer", (PyCFunction)__pyx_pw_7pyarrow_3lib_121as_buffer, METH_O, __pyx_doc_7pyarrow_3lib_120as_buffer};
static PyObject *__pyx_pw_7pyarrow_3lib_121as_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_120as_buffer(__pyx_self, ((PyObject *)__pyx_v_o));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_120as_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":1244
 * 
 * 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":1245
 * 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":1244
 * 
 * def as_buffer(object o):
 *     if isinstance(o, Buffer):             # <<<<<<<<<<<<<<
 *         return o
 *     return py_buffer(o)
 */
  }

  /* "pyarrow/io.pxi":1246
 *     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(6, 1246, __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(6, 1246, __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":1243
 * 
 * 
 * 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":1249
 * 
 * 
 * cdef NativeFile _get_native_file(object source, c_bool use_memory_map):             # <<<<<<<<<<<<<<
 *     try:
 *         source_path = _stringify_path(source)
 */

static struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_f_7pyarrow_3lib__get_native_file(PyObject *__pyx_v_source, bool __pyx_v_use_memory_map) {
  PyObject *__pyx_v_source_path = NULL;
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  __Pyx_RefNannySetupContext("_get_native_file", 0);
  __Pyx_INCREF(__pyx_v_source);

  /* "pyarrow/io.pxi":1250
 * 
 * cdef NativeFile _get_native_file(object source, c_bool use_memory_map):
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "pyarrow/io.pxi":1251
 * cdef NativeFile _get_native_file(object source, c_bool use_memory_map):
 *     try:
 *         source_path = _stringify_path(source)             # <<<<<<<<<<<<<<
 *     except TypeError:
 *         if isinstance(source, Buffer):
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_stringify_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1251, __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(6, 1251, __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":1250
 * 
 * cdef NativeFile _get_native_file(object source, c_bool use_memory_map):
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
    }

    /* "pyarrow/io.pxi":1259
 *             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":1260
 *     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(6, 1260, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1260, __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(6, 1260, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_mode, __pyx_n_u_r) < 0) __PYX_ERR(6, 1260, __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(6, 1260, __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":1259
 *             source = PythonFile(source, mode='r')
 *     else:
 *         if use_memory_map:             # <<<<<<<<<<<<<<
 *             source = memory_map(source_path, mode='r')
 *         else:
 */
        goto __pyx_L9;
      }

      /* "pyarrow/io.pxi":1262
 *             source = memory_map(source_path, mode='r')
 *         else:
 *             source = OSFile(source_path, mode='r')             # <<<<<<<<<<<<<<
 * 
 *     return source
 */
      /*else*/ {
        __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 1262, __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(6, 1262, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_mode, __pyx_n_u_r) < 0) __PYX_ERR(6, 1262, __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(6, 1262, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_5);
        __pyx_t_5 = 0;
      }
      __pyx_L9:;
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1252
 *     try:
 *         source_path = _stringify_path(source)
 *     except TypeError:             # <<<<<<<<<<<<<<
 *         if isinstance(source, Buffer):
 *             source = BufferReader(source)
 */
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_9) {
      __Pyx_AddTraceback("pyarrow.lib._get_native_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_8) < 0) __PYX_ERR(6, 1252, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_8);

      /* "pyarrow/io.pxi":1253
 *         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":1254
 *     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(6, 1254, __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":1253
 *         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":1255
 *         if isinstance(source, Buffer):
 *             source = BufferReader(source)
 *         elif not isinstance(source, NativeFile) and hasattr(source, 'read'):             # <<<<<<<<<<<<<<
 *             # Optimistically hope this is file-like
 *             source = PythonFile(source, mode='r')
 */
      __pyx_t_7 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile); 
      __pyx_t_11 = ((!(__pyx_t_7 != 0)) != 0);
      if (__pyx_t_11) {
      } else {
        __pyx_t_10 = __pyx_t_11;
        goto __pyx_L13_bool_binop_done;
      }
      __pyx_t_11 = __Pyx_HasAttr(__pyx_v_source, __pyx_n_u_read); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(6, 1255, __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":1257
 *         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(6, 1257, __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(6, 1257, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_12);
        if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_mode, __pyx_n_u_r) < 0) __PYX_ERR(6, 1257, __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(6, 1257, __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":1255
 *         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":1250
 * 
 * cdef NativeFile _get_native_file(object source, c_bool use_memory_map):
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "pyarrow/io.pxi":1264
 *             source = OSFile(source_path, mode='r')
 * 
 *     return source             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  if (!(likely(((__pyx_v_source) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile))))) __PYX_ERR(6, 1264, __pyx_L1_error)
  __Pyx_INCREF(__pyx_v_source);
  __pyx_r = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_source);
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1249
 * 
 * 
 * cdef NativeFile _get_native_file(object source, c_bool use_memory_map):             # <<<<<<<<<<<<<<
 *     try:
 *         source_path = _stringify_path(source)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("pyarrow.lib._get_native_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_source_path);
  __Pyx_XDECREF(__pyx_v_source);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1267
 * 
 * 
 * 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_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::shared_ptr<arrow::io::RandomAccessFile>  __pyx_t_2;
  __Pyx_RefNannySetupContext("get_reader", 0);

  /* "pyarrow/io.pxi":1271
 *     cdef NativeFile nf
 * 
 *     nf = _get_native_file(source, use_memory_map)             # <<<<<<<<<<<<<<
 *     reader[0] = nf.get_random_access_file()
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib__get_native_file(__pyx_v_source, __pyx_v_use_memory_map)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_nf = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":1272
 * 
 *     nf = _get_native_file(source, use_memory_map)
 *     reader[0] = nf.get_random_access_file()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_nf->__pyx_vtab)->get_random_access_file(__pyx_v_nf); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 1272, __pyx_L1_error)
  (__pyx_v_reader[0]) = __pyx_t_2;

  /* "pyarrow/io.pxi":1267
 * 
 * 
 * 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_1);
  __Pyx_AddTraceback("pyarrow.lib.get_reader", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_nf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1275
 * 
 * 
 * cdef get_input_stream(object source, c_bool use_memory_map,             # <<<<<<<<<<<<<<
 *                       shared_ptr[InputStream]* out):
 *     """
 */

static PyObject *__pyx_f_7pyarrow_3lib_get_input_stream(PyObject *__pyx_v_source, bool __pyx_v_use_memory_map, std::shared_ptr<arrow::io::InputStream>  *__pyx_v_out) {
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_nf = 0;
  std::unique_ptr< arrow::util::Codec>  __pyx_v_codec;
  std::shared_ptr<arrow::io::InputStream>  __pyx_v_input_stream;
  std::shared_ptr< arrow::io::CompressedInputStream>  __pyx_v_compressed_stream;
  enum  arrow::Compression::type __pyx_v_compression_type;
  PyObject *__pyx_v_source_path = NULL;
  PyObject *__pyx_v_compression = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  enum  arrow::Compression::type __pyx_t_8;
  std::shared_ptr<arrow::io::InputStream>  __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("get_input_stream", 0);

  /* "pyarrow/io.pxi":1288
 *         CompressionType compression_type
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "pyarrow/io.pxi":1289
 * 
 *     try:
 *         source_path = _stringify_path(source)             # <<<<<<<<<<<<<<
 *     except TypeError:
 *         compression = None
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_stringify_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1289, __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(6, 1289, __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":1288
 *         CompressionType compression_type
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
    }

    /* "pyarrow/io.pxi":1293
 *         compression = None
 *     else:
 *         compression = _detect_compression(source_path)             # <<<<<<<<<<<<<<
 * 
 *     compression_type = _get_compression_type(compression)
 */
    /*else:*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_detect_compression); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1293, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_source_path) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_source_path);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1293, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_compression = __pyx_t_4;
      __pyx_t_4 = 0;
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1290
 *     try:
 *         source_path = _stringify_path(source)
 *     except TypeError:             # <<<<<<<<<<<<<<
 *         compression = None
 *     else:
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pyarrow.lib.get_input_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(6, 1290, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "pyarrow/io.pxi":1291
 *         source_path = _stringify_path(source)
 *     except TypeError:
 *         compression = None             # <<<<<<<<<<<<<<
 *     else:
 *         compression = _detect_compression(source_path)
 */
      __Pyx_INCREF(Py_None);
      __pyx_v_compression = Py_None;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/io.pxi":1288
 *         CompressionType compression_type
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "pyarrow/io.pxi":1295
 *         compression = _detect_compression(source_path)
 * 
 *     compression_type = _get_compression_type(compression)             # <<<<<<<<<<<<<<
 *     nf = _get_native_file(source, use_memory_map)
 *     input_stream = nf.get_input_stream()
 */
  __pyx_t_8 = __pyx_f_7pyarrow_3lib__get_compression_type(__pyx_v_compression); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 1295, __pyx_L1_error)
  __pyx_v_compression_type = __pyx_t_8;

  /* "pyarrow/io.pxi":1296
 * 
 *     compression_type = _get_compression_type(compression)
 *     nf = _get_native_file(source, use_memory_map)             # <<<<<<<<<<<<<<
 *     input_stream = nf.get_input_stream()
 * 
 */
  __pyx_t_6 = ((PyObject *)__pyx_f_7pyarrow_3lib__get_native_file(__pyx_v_source, __pyx_v_use_memory_map)); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_nf = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pyarrow/io.pxi":1297
 *     compression_type = _get_compression_type(compression)
 *     nf = _get_native_file(source, use_memory_map)
 *     input_stream = nf.get_input_stream()             # <<<<<<<<<<<<<<
 * 
 *     if compression_type != CompressionType_UNCOMPRESSED:
 */
  __pyx_t_9 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_nf->__pyx_vtab)->get_input_stream(__pyx_v_nf); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 1297, __pyx_L1_error)
  __pyx_v_input_stream = __pyx_t_9;

  /* "pyarrow/io.pxi":1299
 *     input_stream = nf.get_input_stream()
 * 
 *     if compression_type != CompressionType_UNCOMPRESSED:             # <<<<<<<<<<<<<<
 *         check_status(CCodec.Create(compression_type, &codec))
 *         check_status(CCompressedInputStream.Make(codec.get(), input_stream,
 */
  __pyx_t_10 = ((__pyx_v_compression_type !=  arrow::Compression::UNCOMPRESSED) != 0);
  if (__pyx_t_10) {

    /* "pyarrow/io.pxi":1300
 * 
 *     if compression_type != CompressionType_UNCOMPRESSED:
 *         check_status(CCodec.Create(compression_type, &codec))             # <<<<<<<<<<<<<<
 *         check_status(CCompressedInputStream.Make(codec.get(), input_stream,
 *                                                  &compressed_stream))
 */
    __pyx_t_7 = __pyx_f_7pyarrow_3lib_check_status( arrow::util::Codec::Create(__pyx_v_compression_type, (&__pyx_v_codec))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(6, 1300, __pyx_L1_error)

    /* "pyarrow/io.pxi":1301
 *     if compression_type != CompressionType_UNCOMPRESSED:
 *         check_status(CCodec.Create(compression_type, &codec))
 *         check_status(CCompressedInputStream.Make(codec.get(), input_stream,             # <<<<<<<<<<<<<<
 *                                                  &compressed_stream))
 *         input_stream = <shared_ptr[InputStream]> compressed_stream
 */
    __pyx_t_7 = __pyx_f_7pyarrow_3lib_check_status( arrow::io::CompressedInputStream::Make(__pyx_v_codec.get(), __pyx_v_input_stream, (&__pyx_v_compressed_stream))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(6, 1301, __pyx_L1_error)

    /* "pyarrow/io.pxi":1303
 *         check_status(CCompressedInputStream.Make(codec.get(), input_stream,
 *                                                  &compressed_stream))
 *         input_stream = <shared_ptr[InputStream]> compressed_stream             # <<<<<<<<<<<<<<
 * 
 *     out[0] = input_stream
 */
    __pyx_v_input_stream = ((std::shared_ptr<arrow::io::InputStream> )__pyx_v_compressed_stream);

    /* "pyarrow/io.pxi":1299
 *     input_stream = nf.get_input_stream()
 * 
 *     if compression_type != CompressionType_UNCOMPRESSED:             # <<<<<<<<<<<<<<
 *         check_status(CCodec.Create(compression_type, &codec))
 *         check_status(CCompressedInputStream.Make(codec.get(), input_stream,
 */
  }

  /* "pyarrow/io.pxi":1305
 *         input_stream = <shared_ptr[InputStream]> compressed_stream
 * 
 *     out[0] = input_stream             # <<<<<<<<<<<<<<
 * 
 * 
 */
  (__pyx_v_out[0]) = __pyx_v_input_stream;

  /* "pyarrow/io.pxi":1275
 * 
 * 
 * cdef get_input_stream(object source, c_bool use_memory_map,             # <<<<<<<<<<<<<<
 *                       shared_ptr[InputStream]* out):
 *     """
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.get_input_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_nf);
  __Pyx_XDECREF(__pyx_v_source_path);
  __Pyx_XDECREF(__pyx_v_compression);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1308
 * 
 * 
 * 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;
  std::shared_ptr<arrow::io::OutputStream>  __pyx_t_14;
  __Pyx_RefNannySetupContext("get_writer", 0);
  __Pyx_INCREF(__pyx_v_source);

  /* "pyarrow/io.pxi":1311
 *     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":1312
 * 
 *     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(6, 1312, __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(6, 1312, __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":1311
 *     cdef NativeFile nf
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
    }

    /* "pyarrow/io.pxi":1318
 *             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(6, 1318, __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(6, 1318, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_mode, __pyx_n_u_w) < 0) __PYX_ERR(6, 1318, __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(6, 1318, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_6);
      __pyx_t_6 = 0;
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1313
 *     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(6, 1313, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_4);

      /* "pyarrow/io.pxi":1314
 *         source_path = _stringify_path(source)
 *     except TypeError:
 *         if not isinstance(source, NativeFile) and hasattr(source, 'write'):             # <<<<<<<<<<<<<<
 *             # Optimistically hope this is file-like
 *             source = PythonFile(source, mode='w')
 */
      __pyx_t_9 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile); 
      __pyx_t_10 = ((!(__pyx_t_9 != 0)) != 0);
      if (__pyx_t_10) {
      } else {
        __pyx_t_8 = __pyx_t_10;
        goto __pyx_L12_bool_binop_done;
      }
      __pyx_t_10 = __Pyx_HasAttr(__pyx_v_source, __pyx_n_u_write); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(6, 1314, __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":1316
 *         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(6, 1316, __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(6, 1316, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_12);
        if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_mode, __pyx_n_u_w) < 0) __PYX_ERR(6, 1316, __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(6, 1316, __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":1314
 *         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":1311
 *     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":1320
 *         source = OSFile(source_path, mode='w')
 * 
 *     if isinstance(source, NativeFile):             # <<<<<<<<<<<<<<
 *         nf = source
 *         writer[0] = nf.get_output_stream()
 */
  __pyx_t_8 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile); 
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (likely(__pyx_t_9)) {

    /* "pyarrow/io.pxi":1321
 * 
 *     if isinstance(source, NativeFile):
 *         nf = source             # <<<<<<<<<<<<<<
 *         writer[0] = nf.get_output_stream()
 *     else:
 */
    if (!(likely(((__pyx_v_source) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile))))) __PYX_ERR(6, 1321, __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":1322
 *     if isinstance(source, NativeFile):
 *         nf = source
 *         writer[0] = nf.get_output_stream()             # <<<<<<<<<<<<<<
 *     else:
 *         raise TypeError('Unable to read from object of type: {0}'
 */
    __pyx_t_14 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_nf->__pyx_vtab)->get_output_stream(__pyx_v_nf); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 1322, __pyx_L1_error)
    (__pyx_v_writer[0]) = __pyx_t_14;

    /* "pyarrow/io.pxi":1320
 *         source = OSFile(source_path, mode='w')
 * 
 *     if isinstance(source, NativeFile):             # <<<<<<<<<<<<<<
 *         nf = source
 *         writer[0] = nf.get_output_stream()
 */
    goto __pyx_L14;
  }

  /* "pyarrow/io.pxi":1324
 *         writer[0] = nf.get_output_stream()
 *     else:
 *         raise TypeError('Unable to read from object of type: {0}'             # <<<<<<<<<<<<<<
 *                         .format(type(source)))
 * 
 */
  /*else*/ {

    /* "pyarrow/io.pxi":1325
 *     else:
 *         raise TypeError('Unable to read from object of type: {0}'
 *                         .format(type(source)))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unable_to_read_from_object_of_ty, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1325, __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(6, 1325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pyarrow/io.pxi":1324
 *         writer[0] = nf.get_output_stream()
 *     else:
 *         raise TypeError('Unable to read from object of type: {0}'             # <<<<<<<<<<<<<<
 *                         .format(type(source)))
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(6, 1324, __pyx_L1_error)
  }
  __pyx_L14:;

  /* "pyarrow/io.pxi":1308
 * 
 * 
 * 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":1330
 * # ---------------------------------------------------------------------
 * 
 * cdef CompressionType _get_compression_type(object name) except *:             # <<<<<<<<<<<<<<
 *     if name is None or name == 'uncompressed':
 *         return CompressionType_UNCOMPRESSED
 */

static enum  arrow::Compression::type __pyx_f_7pyarrow_3lib__get_compression_type(PyObject *__pyx_v_name) {
  enum  arrow::Compression::type __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("_get_compression_type", 0);

  /* "pyarrow/io.pxi":1331
 * 
 * cdef CompressionType _get_compression_type(object name) except *:
 *     if name is None or name == 'uncompressed':             # <<<<<<<<<<<<<<
 *         return CompressionType_UNCOMPRESSED
 *     elif name == 'bz2':
 */
  __pyx_t_2 = (__pyx_v_name == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_n_u_uncompressed, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(6, 1331, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":1332
 * cdef CompressionType _get_compression_type(object name) except *:
 *     if name is None or name == 'uncompressed':
 *         return CompressionType_UNCOMPRESSED             # <<<<<<<<<<<<<<
 *     elif name == 'bz2':
 *         return CompressionType_BZ2
 */
    __pyx_r =  arrow::Compression::UNCOMPRESSED;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1331
 * 
 * cdef CompressionType _get_compression_type(object name) except *:
 *     if name is None or name == 'uncompressed':             # <<<<<<<<<<<<<<
 *         return CompressionType_UNCOMPRESSED
 *     elif name == 'bz2':
 */
  }

  /* "pyarrow/io.pxi":1333
 *     if name is None or name == 'uncompressed':
 *         return CompressionType_UNCOMPRESSED
 *     elif name == 'bz2':             # <<<<<<<<<<<<<<
 *         return CompressionType_BZ2
 *     elif name == 'brotli':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_n_u_bz2, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 1333, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":1334
 *         return CompressionType_UNCOMPRESSED
 *     elif name == 'bz2':
 *         return CompressionType_BZ2             # <<<<<<<<<<<<<<
 *     elif name == 'brotli':
 *         return CompressionType_BROTLI
 */
    __pyx_r =  arrow::Compression::BZ2;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1333
 *     if name is None or name == 'uncompressed':
 *         return CompressionType_UNCOMPRESSED
 *     elif name == 'bz2':             # <<<<<<<<<<<<<<
 *         return CompressionType_BZ2
 *     elif name == 'brotli':
 */
  }

  /* "pyarrow/io.pxi":1335
 *     elif name == 'bz2':
 *         return CompressionType_BZ2
 *     elif name == 'brotli':             # <<<<<<<<<<<<<<
 *         return CompressionType_BROTLI
 *     elif name == 'gzip':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_n_u_brotli, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 1335, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":1336
 *         return CompressionType_BZ2
 *     elif name == 'brotli':
 *         return CompressionType_BROTLI             # <<<<<<<<<<<<<<
 *     elif name == 'gzip':
 *         return CompressionType_GZIP
 */
    __pyx_r =  arrow::Compression::BROTLI;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1335
 *     elif name == 'bz2':
 *         return CompressionType_BZ2
 *     elif name == 'brotli':             # <<<<<<<<<<<<<<
 *         return CompressionType_BROTLI
 *     elif name == 'gzip':
 */
  }

  /* "pyarrow/io.pxi":1337
 *     elif name == 'brotli':
 *         return CompressionType_BROTLI
 *     elif name == 'gzip':             # <<<<<<<<<<<<<<
 *         return CompressionType_GZIP
 *     elif name == 'lz4':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_n_u_gzip, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 1337, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":1338
 *         return CompressionType_BROTLI
 *     elif name == 'gzip':
 *         return CompressionType_GZIP             # <<<<<<<<<<<<<<
 *     elif name == 'lz4':
 *         return CompressionType_LZ4
 */
    __pyx_r =  arrow::Compression::GZIP;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1337
 *     elif name == 'brotli':
 *         return CompressionType_BROTLI
 *     elif name == 'gzip':             # <<<<<<<<<<<<<<
 *         return CompressionType_GZIP
 *     elif name == 'lz4':
 */
  }

  /* "pyarrow/io.pxi":1339
 *     elif name == 'gzip':
 *         return CompressionType_GZIP
 *     elif name == 'lz4':             # <<<<<<<<<<<<<<
 *         return CompressionType_LZ4
 *     elif name == 'snappy':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_n_u_lz4, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 1339, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":1340
 *         return CompressionType_GZIP
 *     elif name == 'lz4':
 *         return CompressionType_LZ4             # <<<<<<<<<<<<<<
 *     elif name == 'snappy':
 *         return CompressionType_SNAPPY
 */
    __pyx_r =  arrow::Compression::LZ4;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1339
 *     elif name == 'gzip':
 *         return CompressionType_GZIP
 *     elif name == 'lz4':             # <<<<<<<<<<<<<<
 *         return CompressionType_LZ4
 *     elif name == 'snappy':
 */
  }

  /* "pyarrow/io.pxi":1341
 *     elif name == 'lz4':
 *         return CompressionType_LZ4
 *     elif name == 'snappy':             # <<<<<<<<<<<<<<
 *         return CompressionType_SNAPPY
 *     elif name == 'zstd':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_n_u_snappy, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 1341, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":1342
 *         return CompressionType_LZ4
 *     elif name == 'snappy':
 *         return CompressionType_SNAPPY             # <<<<<<<<<<<<<<
 *     elif name == 'zstd':
 *         return CompressionType_ZSTD
 */
    __pyx_r =  arrow::Compression::SNAPPY;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1341
 *     elif name == 'lz4':
 *         return CompressionType_LZ4
 *     elif name == 'snappy':             # <<<<<<<<<<<<<<
 *         return CompressionType_SNAPPY
 *     elif name == 'zstd':
 */
  }

  /* "pyarrow/io.pxi":1343
 *     elif name == 'snappy':
 *         return CompressionType_SNAPPY
 *     elif name == 'zstd':             # <<<<<<<<<<<<<<
 *         return CompressionType_ZSTD
 *     else:
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_n_u_zstd, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 1343, __pyx_L1_error)
  if (likely(__pyx_t_1)) {

    /* "pyarrow/io.pxi":1344
 *         return CompressionType_SNAPPY
 *     elif name == 'zstd':
 *         return CompressionType_ZSTD             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError('Unrecognized compression type: {}'.format(name))
 */
    __pyx_r =  arrow::Compression::ZSTD;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1343
 *     elif name == 'snappy':
 *         return CompressionType_SNAPPY
 *     elif name == 'zstd':             # <<<<<<<<<<<<<<
 *         return CompressionType_ZSTD
 *     else:
 */
  }

  /* "pyarrow/io.pxi":1346
 *         return CompressionType_ZSTD
 *     else:
 *         raise ValueError('Unrecognized compression type: {}'.format(name))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unrecognized_compression_type, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1346, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_name);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1346, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1346, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(6, 1346, __pyx_L1_error)
  }

  /* "pyarrow/io.pxi":1330
 * # ---------------------------------------------------------------------
 * 
 * cdef CompressionType _get_compression_type(object name) except *:             # <<<<<<<<<<<<<<
 *     if name is None or name == 'uncompressed':
 *         return CompressionType_UNCOMPRESSED
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib._get_compression_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = (enum  arrow::Compression::type) 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1349
 * 
 * 
 * def _detect_compression(path):             # <<<<<<<<<<<<<<
 *     if isinstance(path, six.string_types):
 *         if path.endswith('.bz2'):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_123_detect_compression(PyObject *__pyx_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_7pyarrow_3lib_122_detect_compression[] = "_detect_compression(path)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_123_detect_compression = {"_detect_compression", (PyCFunction)__pyx_pw_7pyarrow_3lib_123_detect_compression, METH_O, __pyx_doc_7pyarrow_3lib_122_detect_compression};
static PyObject *__pyx_pw_7pyarrow_3lib_123_detect_compression(PyObject *__pyx_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_detect_compression (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_122_detect_compression(__pyx_self, ((PyObject *)__pyx_v_path));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_122_detect_compression(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("_detect_compression", 0);

  /* "pyarrow/io.pxi":1350
 * 
 * def _detect_compression(path):
 *     if isinstance(path, six.string_types):             # <<<<<<<<<<<<<<
 *         if path.endswith('.bz2'):
 *             return 'bz2'
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_six); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_string_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_path, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(6, 1350, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/io.pxi":1351
 * def _detect_compression(path):
 *     if isinstance(path, six.string_types):
 *         if path.endswith('.bz2'):             # <<<<<<<<<<<<<<
 *             return 'bz2'
 *         elif path.endswith('.gz'):
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_path, __pyx_n_s_endswith); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1351, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_kp_u_bz2_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_kp_u_bz2_2);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1351, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(6, 1351, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_4) {

      /* "pyarrow/io.pxi":1352
 *     if isinstance(path, six.string_types):
 *         if path.endswith('.bz2'):
 *             return 'bz2'             # <<<<<<<<<<<<<<
 *         elif path.endswith('.gz'):
 *             return 'gzip'
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_n_u_bz2);
      __pyx_r = __pyx_n_u_bz2;
      goto __pyx_L0;

      /* "pyarrow/io.pxi":1351
 * def _detect_compression(path):
 *     if isinstance(path, six.string_types):
 *         if path.endswith('.bz2'):             # <<<<<<<<<<<<<<
 *             return 'bz2'
 *         elif path.endswith('.gz'):
 */
    }

    /* "pyarrow/io.pxi":1353
 *         if path.endswith('.bz2'):
 *             return 'bz2'
 *         elif path.endswith('.gz'):             # <<<<<<<<<<<<<<
 *             return 'gzip'
 *         elif path.endswith('.lz4'):
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_path, __pyx_n_s_endswith); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1353, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_kp_u_gz) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_kp_u_gz);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1353, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(6, 1353, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_4) {

      /* "pyarrow/io.pxi":1354
 *             return 'bz2'
 *         elif path.endswith('.gz'):
 *             return 'gzip'             # <<<<<<<<<<<<<<
 *         elif path.endswith('.lz4'):
 *             return 'lz4'
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_n_u_gzip);
      __pyx_r = __pyx_n_u_gzip;
      goto __pyx_L0;

      /* "pyarrow/io.pxi":1353
 *         if path.endswith('.bz2'):
 *             return 'bz2'
 *         elif path.endswith('.gz'):             # <<<<<<<<<<<<<<
 *             return 'gzip'
 *         elif path.endswith('.lz4'):
 */
    }

    /* "pyarrow/io.pxi":1355
 *         elif path.endswith('.gz'):
 *             return 'gzip'
 *         elif path.endswith('.lz4'):             # <<<<<<<<<<<<<<
 *             return 'lz4'
 *         elif path.endswith('.zst'):
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_path, __pyx_n_s_endswith); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1355, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_kp_u_lz4_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_kp_u_lz4_2);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1355, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(6, 1355, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_4) {

      /* "pyarrow/io.pxi":1356
 *             return 'gzip'
 *         elif path.endswith('.lz4'):
 *             return 'lz4'             # <<<<<<<<<<<<<<
 *         elif path.endswith('.zst'):
 *             return 'zstd'
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_n_u_lz4);
      __pyx_r = __pyx_n_u_lz4;
      goto __pyx_L0;

      /* "pyarrow/io.pxi":1355
 *         elif path.endswith('.gz'):
 *             return 'gzip'
 *         elif path.endswith('.lz4'):             # <<<<<<<<<<<<<<
 *             return 'lz4'
 *         elif path.endswith('.zst'):
 */
    }

    /* "pyarrow/io.pxi":1357
 *         elif path.endswith('.lz4'):
 *             return 'lz4'
 *         elif path.endswith('.zst'):             # <<<<<<<<<<<<<<
 *             return 'zstd'
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_path, __pyx_n_s_endswith); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1357, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_kp_u_zst) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_kp_u_zst);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1357, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(6, 1357, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_4) {

      /* "pyarrow/io.pxi":1358
 *             return 'lz4'
 *         elif path.endswith('.zst'):
 *             return 'zstd'             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_n_u_zstd);
      __pyx_r = __pyx_n_u_zstd;
      goto __pyx_L0;

      /* "pyarrow/io.pxi":1357
 *         elif path.endswith('.lz4'):
 *             return 'lz4'
 *         elif path.endswith('.zst'):             # <<<<<<<<<<<<<<
 *             return 'zstd'
 * 
 */
    }

    /* "pyarrow/io.pxi":1350
 * 
 * def _detect_compression(path):
 *     if isinstance(path, six.string_types):             # <<<<<<<<<<<<<<
 *         if path.endswith('.bz2'):
 *             return 'bz2'
 */
  }

  /* "pyarrow/io.pxi":1349
 * 
 * 
 * def _detect_compression(path):             # <<<<<<<<<<<<<<
 *     if isinstance(path, six.string_types):
 *         if path.endswith('.bz2'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib._detect_compression", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1361
 * 
 * 
 * def compress(object buf, codec='lz4', asbytes=False, memory_pool=None):             # <<<<<<<<<<<<<<
 *     """
 *     Compress data from buffer-like object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_125compress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_124compress[] = "compress(buf, codec=u'lz4', asbytes=False, memory_pool=None)\n\n    Compress data from buffer-like object.\n\n    Parameters\n    ----------\n    buf : pyarrow.Buffer, bytes, or other object supporting buffer protocol\n    codec : string, default 'lz4'\n        Compression codec.\n        Supported types: {'brotli, 'gzip', 'lz4', 'snappy', 'zstd'}\n    asbytes : boolean, default False\n        Return result as Python bytes object, otherwise Buffer\n    memory_pool : MemoryPool, default None\n        Memory pool to use for buffer allocations, if any\n\n    Returns\n    -------\n    compressed : pyarrow.Buffer or bytes (if asbytes=True)\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_125compress = {"compress", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_125compress, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_124compress};
static PyObject *__pyx_pw_7pyarrow_3lib_125compress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_buf = 0;
  PyObject *__pyx_v_codec = 0;
  PyObject *__pyx_v_asbytes = 0;
  PyObject *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("compress (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_buf,&__pyx_n_s_codec,&__pyx_n_s_asbytes,&__pyx_n_s_memory_pool,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)__pyx_n_u_lz4);
    values[2] = ((PyObject *)Py_False);
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buf)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_codec);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_asbytes);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compress") < 0)) __PYX_ERR(6, 1361, __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(6, 1361, __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_124compress(__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_124compress(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
  enum  arrow::Compression::type __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("compress", 0);
  __Pyx_INCREF(__pyx_v_buf);

  /* "pyarrow/io.pxi":1381
 *     """
 *     cdef:
 *         CompressionType c_codec = _get_compression_type(codec)             # <<<<<<<<<<<<<<
 *         unique_ptr[CCodec] compressor
 *         cdef CBuffer* c_buf
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__get_compression_type(__pyx_v_codec); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 1381, __pyx_L1_error)
  __pyx_v_c_codec = __pyx_t_1;

  /* "pyarrow/io.pxi":1387
 *         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":1388
 * 
 *     with nogil:
 *         check_status(CCodec.Create(c_codec, &compressor))             # <<<<<<<<<<<<<<
 * 
 *     buf = as_buffer(buf)
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status( arrow::util::Codec::Create(__pyx_v_c_codec, (&__pyx_v_compressor))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 1388, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":1387
 *         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":1390
 *         check_status(CCodec.Create(c_codec, &compressor))
 * 
 *     buf = as_buffer(buf)             # <<<<<<<<<<<<<<
 *     c_buf = (<Buffer> buf).buffer.get()
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_as_buffer); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1390, __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_buf) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_buf);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF_SET(__pyx_v_buf, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyarrow/io.pxi":1391
 * 
 *     buf = as_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":1394
 * 
 *     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":1396
 *                                     .MaxCompressedLen(c_buf.size(),
 *                                                       c_buf.data()))
 *     cdef uint8_t* output_buffer = NULL             # <<<<<<<<<<<<<<
 * 
 *     if asbytes:
 */
  __pyx_v_output_buffer = NULL;

  /* "pyarrow/io.pxi":1398
 *     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_6 = __Pyx_PyObject_IsTrue(__pyx_v_asbytes); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(6, 1398, __pyx_L1_error)
  if (__pyx_t_6) {

    /* "pyarrow/io.pxi":1399
 * 
 *     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(6, 1399, __pyx_L1_error)
    __pyx_v_pyobj = __pyx_t_7;

    /* "pyarrow/io.pxi":1400
 *     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":1398
 *     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_L6;
  }

  /* "pyarrow/io.pxi":1402
 *         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_3, __pyx_n_s_allocate_buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyInt_From_int64_t(__pyx_v_max_output_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1402, __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;
    __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1402, __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(6, 1402, __pyx_L1_error)

    /* "pyarrow/io.pxi":1403
 *     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_4, __pyx_n_s_resizable, Py_True) < 0) __PYX_ERR(6, 1402, __pyx_L1_error)

    /* "pyarrow/io.pxi":1402
 *         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_3, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 1402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_ResizableBuffer))))) __PYX_ERR(6, 1402, __pyx_L1_error)
    __pyx_v_out_buf = ((struct __pyx_obj_7pyarrow_3lib_ResizableBuffer *)__pyx_t_8);
    __pyx_t_8 = 0;

    /* "pyarrow/io.pxi":1404
 *         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_L6:;

  /* "pyarrow/io.pxi":1406
 *         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":1407
 * 
 *     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":1408
 *     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_2 = __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_2 == ((int)-1))) __PYX_ERR(6, 1408, __pyx_L8_error)
      }

      /* "pyarrow/io.pxi":1407
 * 
 *     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_L9;
        }
        __pyx_L8_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L9:;
      }
  }

  /* "pyarrow/io.pxi":1413
 *                                &output_length))
 * 
 *     if asbytes:             # <<<<<<<<<<<<<<
 *         cp._PyBytes_Resize(&pyobj, <Py_ssize_t> output_length)
 *         return PyObject_to_object(pyobj)
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_asbytes); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(6, 1413, __pyx_L1_error)
  if (__pyx_t_6) {

    /* "pyarrow/io.pxi":1414
 * 
 *     if asbytes:
 *         cp._PyBytes_Resize(&pyobj, <Py_ssize_t> output_length)             # <<<<<<<<<<<<<<
 *         return PyObject_to_object(pyobj)
 *     else:
 */
    __pyx_t_2 = _PyBytes_Resize((&__pyx_v_pyobj), ((Py_ssize_t)__pyx_v_output_length)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 1414, __pyx_L1_error)

    /* "pyarrow/io.pxi":1415
 *     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(6, 1415, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_r = __pyx_t_8;
    __pyx_t_8 = 0;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1413
 *                                &output_length))
 * 
 *     if asbytes:             # <<<<<<<<<<<<<<
 *         cp._PyBytes_Resize(&pyobj, <Py_ssize_t> output_length)
 *         return PyObject_to_object(pyobj)
 */
  }

  /* "pyarrow/io.pxi":1417
 *         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(6, 1417, __pyx_L1_error) }
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out_buf), __pyx_n_s_resize); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1417, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_output_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1417, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __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_8 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 1417, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "pyarrow/io.pxi":1418
 *     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(6, 1418, __pyx_L1_error) }
    __Pyx_INCREF(((PyObject *)__pyx_v_out_buf));
    __pyx_r = ((PyObject *)__pyx_v_out_buf);
    goto __pyx_L0;
  }

  /* "pyarrow/io.pxi":1361
 * 
 * 
 * def compress(object buf, codec='lz4', asbytes=False, memory_pool=None):             # <<<<<<<<<<<<<<
 *     """
 *     Compress data from buffer-like object.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __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":1421
 * 
 * 
 * def decompress(object buf, decompressed_size=None, codec='lz4',             # <<<<<<<<<<<<<<
 *                asbytes=False, memory_pool=None):
 *     """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_127decompress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_126decompress[] = "decompress(buf, decompressed_size=None, codec=u'lz4', asbytes=False, memory_pool=None)\n\n    Decompress data from buffer-like object.\n\n    Parameters\n    ----------\n    buf : pyarrow.Buffer, bytes, or memoryview-compatible object\n    decompressed_size : int64_t, default None\n        If not specified, will be computed if the codec is able to determine\n        the uncompressed buffer size\n    codec : string, default 'lz4'\n        Compression codec.\n        Supported types: {'brotli, 'gzip', 'lz4', 'snappy', 'zstd'}\n    asbytes : boolean, default False\n        Return result as Python bytes object, otherwise Buffer\n    memory_pool : MemoryPool, default None\n        Memory pool to use for buffer allocations, if any\n\n    Returns\n    -------\n    uncompressed : pyarrow.Buffer or bytes (if asbytes=True)\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_127decompress = {"decompress", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_127decompress, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_126decompress};
static PyObject *__pyx_pw_7pyarrow_3lib_127decompress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_buf = 0;
  PyObject *__pyx_v_decompressed_size = 0;
  PyObject *__pyx_v_codec = 0;
  PyObject *__pyx_v_asbytes = 0;
  PyObject *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decompress (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_buf,&__pyx_n_s_decompressed_size,&__pyx_n_s_codec,&__pyx_n_s_asbytes,&__pyx_n_s_memory_pool,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)__pyx_n_u_lz4);

    /* "pyarrow/io.pxi":1422
 * 
 * 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(6, 1421, __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(6, 1421, __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_126decompress(__pyx_self, __pyx_v_buf, __pyx_v_decompressed_size, __pyx_v_codec, __pyx_v_asbytes, __pyx_v_memory_pool);

  /* "pyarrow/io.pxi":1421
 * 
 * 
 * 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_126decompress(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
  enum  arrow::Compression::type __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int64_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("decompress", 0);
  __Pyx_INCREF(__pyx_v_buf);

  /* "pyarrow/io.pxi":1445
 *     """
 *     cdef:
 *         CompressionType c_codec = _get_compression_type(codec)             # <<<<<<<<<<<<<<
 *         unique_ptr[CCodec] compressor
 *         cdef CBuffer* c_buf
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__get_compression_type(__pyx_v_codec); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 1445, __pyx_L1_error)
  __pyx_v_c_codec = __pyx_t_1;

  /* "pyarrow/io.pxi":1450
 *         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":1451
 * 
 *     with nogil:
 *         check_status(CCodec.Create(c_codec, &compressor))             # <<<<<<<<<<<<<<
 * 
 *     buf = as_buffer(buf)
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status( arrow::util::Codec::Create(__pyx_v_c_codec, (&__pyx_v_compressor))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 1451, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":1450
 *         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":1453
 *         check_status(CCodec.Create(c_codec, &compressor))
 * 
 *     buf = as_buffer(buf)             # <<<<<<<<<<<<<<
 *     c_buf = (<Buffer> buf).buffer.get()
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_as_buffer); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1453, __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_buf) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_buf);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF_SET(__pyx_v_buf, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyarrow/io.pxi":1454
 * 
 *     buf = as_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":1456
 *     c_buf = (<Buffer> buf).buffer.get()
 * 
 *     if decompressed_size is None:             # <<<<<<<<<<<<<<
 *         raise ValueError("Must pass decompressed_size for {0} codec"
 *                          .format(codec))
 */
  __pyx_t_6 = (__pyx_v_decompressed_size == Py_None);
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (unlikely(__pyx_t_7)) {

    /* "pyarrow/io.pxi":1458
 *     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_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Must_pass_decompressed_size_for, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1458, __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_codec) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_codec);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/io.pxi":1457
 * 
 *     if decompressed_size is None:
 *         raise ValueError("Must pass decompressed_size for {0} codec"             # <<<<<<<<<<<<<<
 *                          .format(codec))
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1457, __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(6, 1457, __pyx_L1_error)

    /* "pyarrow/io.pxi":1456
 *     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":1460
 *                          .format(codec))
 * 
 *     cdef int64_t output_size = decompressed_size             # <<<<<<<<<<<<<<
 *     cdef uint8_t* output_buffer = NULL
 * 
 */
  __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_v_decompressed_size); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 1460, __pyx_L1_error)
  __pyx_v_output_size = __pyx_t_8;

  /* "pyarrow/io.pxi":1461
 * 
 *     cdef int64_t output_size = decompressed_size
 *     cdef uint8_t* output_buffer = NULL             # <<<<<<<<<<<<<<
 * 
 *     if asbytes:
 */
  __pyx_v_output_buffer = NULL;

  /* "pyarrow/io.pxi":1463
 *     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_7 = __Pyx_PyObject_IsTrue(__pyx_v_asbytes); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(6, 1463, __pyx_L1_error)
  if (__pyx_t_7) {

    /* "pyarrow/io.pxi":1464
 * 
 *     if asbytes:
 *         pybuf = cp.PyBytes_FromStringAndSize(NULL, output_size)             # <<<<<<<<<<<<<<
 *         output_buffer = <uint8_t*> cp.PyBytes_AS_STRING(pybuf)
 *     else:
 */
    __pyx_t_4 = PyBytes_FromStringAndSize(NULL, __pyx_v_output_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1464, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_pybuf = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/io.pxi":1465
 *     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":1463
 *     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_L7;
  }

  /* "pyarrow/io.pxi":1467
 *         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_4, __pyx_n_s_allocate_buffer); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1467, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_output_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1467, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1467, __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 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1467, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_memory_pool, __pyx_v_memory_pool) < 0) __PYX_ERR(6, 1467, __pyx_L1_error)
    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 1467, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_7pyarrow_3lib_Buffer))))) __PYX_ERR(6, 1467, __pyx_L1_error)
    __pyx_v_out_buf = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_t_9);
    __pyx_t_9 = 0;

    /* "pyarrow/io.pxi":1468
 *     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_L7:;

  /* "pyarrow/io.pxi":1470
 *         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":1471
 * 
 *     with nogil:
 *         check_status(compressor.get()             # <<<<<<<<<<<<<<
 *                      .Decompress(c_buf.size(), c_buf.data(),
 *                                  output_size, output_buffer))
 */
        __pyx_t_2 = __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_2 == ((int)-1))) __PYX_ERR(6, 1471, __pyx_L9_error)
      }

      /* "pyarrow/io.pxi":1470
 *         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_L10;
        }
        __pyx_L9_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L10:;
      }
  }

  /* "pyarrow/io.pxi":1475
 *                                  output_size, output_buffer))
 * 
 *     return pybuf if asbytes else out_buf             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_asbytes); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(6, 1475, __pyx_L1_error)
  if (__pyx_t_7) {
    if (unlikely(!__pyx_v_pybuf)) { __Pyx_RaiseUnboundLocalError("pybuf"); __PYX_ERR(6, 1475, __pyx_L1_error) }
    __Pyx_INCREF(__pyx_v_pybuf);
    __pyx_t_9 = __pyx_v_pybuf;
  } else {
    if (unlikely(!__pyx_v_out_buf)) { __Pyx_RaiseUnboundLocalError("out_buf"); __PYX_ERR(6, 1475, __pyx_L1_error) }
    __Pyx_INCREF(((PyObject *)__pyx_v_out_buf));
    __pyx_t_9 = ((PyObject *)__pyx_v_out_buf);
  }
  __pyx_r = __pyx_t_9;
  __pyx_t_9 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1421
 * 
 * 
 * def decompress(object buf, decompressed_size=None, codec='lz4',             # <<<<<<<<<<<<<<
 *                asbytes=False, 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_9);
  __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.pxi":1478
 * 
 * 
 * def input_stream(source, compression='detect', buffer_size=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create an Arrow input stream.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_129input_stream(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_128input_stream[] = "input_stream(source, compression=u'detect', buffer_size=None)\n\n    Create an Arrow input stream.\n\n    Parameters\n    ----------\n    source: str, Path, buffer, file-like object, ...\n        The source to open for reading\n    compression: str or None\n        The compression algorithm to use for on-the-fly decompression.\n        If \"detect\" and source is a file path, then compression will be\n        chosen based on the file extension.\n        If None, no compression will be applied.\n        Otherwise, a well-known algorithm name must be supplied (e.g. \"gzip\")\n    buffer_size: int, default None\n        If None or 0, no buffering will happen.  Otherwise the size of the\n        temporary read buffer.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_129input_stream = {"input_stream", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_129input_stream, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_128input_stream};
static PyObject *__pyx_pw_7pyarrow_3lib_129input_stream(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_source = 0;
  PyObject *__pyx_v_compression = 0;
  PyObject *__pyx_v_buffer_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("input_stream (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_compression,&__pyx_n_s_buffer_size,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_n_u_detect);
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_compression);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer_size);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "input_stream") < 0)) __PYX_ERR(6, 1478, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_source = values[0];
    __pyx_v_compression = values[1];
    __pyx_v_buffer_size = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("input_stream", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1478, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.input_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_128input_stream(__pyx_self, __pyx_v_source, __pyx_v_compression, __pyx_v_buffer_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_128input_stream(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_compression, PyObject *__pyx_v_buffer_size) {
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream = 0;
  PyObject *__pyx_v_source_path = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("input_stream", 0);
  __Pyx_INCREF(__pyx_v_compression);

  /* "pyarrow/io.pxi":1498
 *     cdef NativeFile stream
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "pyarrow/io.pxi":1499
 * 
 *     try:
 *         source_path = _stringify_path(source)             # <<<<<<<<<<<<<<
 *     except TypeError:
 *         source_path = None
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_stringify_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1499, __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(6, 1499, __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":1498
 *     cdef NativeFile stream
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1500
 *     try:
 *         source_path = _stringify_path(source)
 *     except TypeError:             # <<<<<<<<<<<<<<
 *         source_path = None
 * 
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pyarrow.lib.input_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(6, 1500, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "pyarrow/io.pxi":1501
 *         source_path = _stringify_path(source)
 *     except TypeError:
 *         source_path = None             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(source, NativeFile):
 */
      __Pyx_INCREF(Py_None);
      __Pyx_XDECREF_SET(__pyx_v_source_path, Py_None);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/io.pxi":1498
 *     cdef NativeFile stream
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "pyarrow/io.pxi":1503
 *         source_path = None
 * 
 *     if isinstance(source, NativeFile):             # <<<<<<<<<<<<<<
 *         stream = source
 *     elif source_path is not None:
 */
  __pyx_t_8 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile); 
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "pyarrow/io.pxi":1504
 * 
 *     if isinstance(source, NativeFile):
 *         stream = source             # <<<<<<<<<<<<<<
 *     elif source_path is not None:
 *         stream = OSFile(source_path, 'r')
 */
    if (!(likely(((__pyx_v_source) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile))))) __PYX_ERR(6, 1504, __pyx_L1_error)
    __pyx_t_6 = __pyx_v_source;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1503
 *         source_path = None
 * 
 *     if isinstance(source, NativeFile):             # <<<<<<<<<<<<<<
 *         stream = source
 *     elif source_path is not None:
 */
    goto __pyx_L11;
  }

  /* "pyarrow/io.pxi":1505
 *     if isinstance(source, NativeFile):
 *         stream = source
 *     elif source_path is not None:             # <<<<<<<<<<<<<<
 *         stream = OSFile(source_path, 'r')
 *     elif isinstance(source, (Buffer, memoryview)):
 */
  __pyx_t_9 = (__pyx_v_source_path != Py_None);
  __pyx_t_8 = (__pyx_t_9 != 0);
  if (__pyx_t_8) {

    /* "pyarrow/io.pxi":1506
 *         stream = source
 *     elif source_path is not None:
 *         stream = OSFile(source_path, 'r')             # <<<<<<<<<<<<<<
 *     elif isinstance(source, (Buffer, memoryview)):
 *         stream = BufferReader(as_buffer(source))
 */
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1506, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_source_path);
    __Pyx_GIVEREF(__pyx_v_source_path);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_source_path);
    __Pyx_INCREF(__pyx_n_u_r);
    __Pyx_GIVEREF(__pyx_n_u_r);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_u_r);
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_OSFile), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1506, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "pyarrow/io.pxi":1505
 *     if isinstance(source, NativeFile):
 *         stream = source
 *     elif source_path is not None:             # <<<<<<<<<<<<<<
 *         stream = OSFile(source_path, 'r')
 *     elif isinstance(source, (Buffer, memoryview)):
 */
    goto __pyx_L11;
  }

  /* "pyarrow/io.pxi":1507
 *     elif source_path is not None:
 *         stream = OSFile(source_path, 'r')
 *     elif isinstance(source, (Buffer, memoryview)):             # <<<<<<<<<<<<<<
 *         stream = BufferReader(as_buffer(source))
 *     elif isinstance(source, BufferedIOBase):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_memoryview); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_9 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_Buffer); 
  __pyx_t_10 = (__pyx_t_9 != 0);
  if (!__pyx_t_10) {
  } else {
    __pyx_t_8 = __pyx_t_10;
    goto __pyx_L12_bool_binop_done;
  }
  __pyx_t_10 = PyObject_IsInstance(__pyx_v_source, __pyx_t_5); 
  __pyx_t_9 = (__pyx_t_10 != 0);
  __pyx_t_8 = __pyx_t_9;
  __pyx_L12_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "pyarrow/io.pxi":1508
 *         stream = OSFile(source_path, 'r')
 *     elif isinstance(source, (Buffer, memoryview)):
 *         stream = BufferReader(as_buffer(source))             # <<<<<<<<<<<<<<
 *     elif isinstance(source, BufferedIOBase):
 *         stream = PythonFile(source, 'r')
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_as_buffer); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_source);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_BufferReader), __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1507
 *     elif source_path is not None:
 *         stream = OSFile(source_path, 'r')
 *     elif isinstance(source, (Buffer, memoryview)):             # <<<<<<<<<<<<<<
 *         stream = BufferReader(as_buffer(source))
 *     elif isinstance(source, BufferedIOBase):
 */
    goto __pyx_L11;
  }

  /* "pyarrow/io.pxi":1509
 *     elif isinstance(source, (Buffer, memoryview)):
 *         stream = BufferReader(as_buffer(source))
 *     elif isinstance(source, BufferedIOBase):             # <<<<<<<<<<<<<<
 *         stream = PythonFile(source, 'r')
 *     elif file_type is not None and isinstance(source, file_type):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_BufferedIOBase); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_9 = PyObject_IsInstance(__pyx_v_source, __pyx_t_6); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(6, 1509, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = (__pyx_t_9 != 0);
  if (__pyx_t_8) {

    /* "pyarrow/io.pxi":1510
 *         stream = BufferReader(as_buffer(source))
 *     elif isinstance(source, BufferedIOBase):
 *         stream = PythonFile(source, 'r')             # <<<<<<<<<<<<<<
 *     elif file_type is not None and isinstance(source, file_type):
 *         # Python 2 file type
 */
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1510, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_source);
    __Pyx_GIVEREF(__pyx_v_source);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_source);
    __Pyx_INCREF(__pyx_n_u_r);
    __Pyx_GIVEREF(__pyx_n_u_r);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_u_r);
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_PythonFile), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1510, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "pyarrow/io.pxi":1509
 *     elif isinstance(source, (Buffer, memoryview)):
 *         stream = BufferReader(as_buffer(source))
 *     elif isinstance(source, BufferedIOBase):             # <<<<<<<<<<<<<<
 *         stream = PythonFile(source, 'r')
 *     elif file_type is not None and isinstance(source, file_type):
 */
    goto __pyx_L11;
  }

  /* "pyarrow/io.pxi":1511
 *     elif isinstance(source, BufferedIOBase):
 *         stream = PythonFile(source, 'r')
 *     elif file_type is not None and isinstance(source, file_type):             # <<<<<<<<<<<<<<
 *         # Python 2 file type
 *         stream = PythonFile(source, 'r')
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_file_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_9 = (__pyx_t_5 != Py_None);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_10 = (__pyx_t_9 != 0);
  if (__pyx_t_10) {
  } else {
    __pyx_t_8 = __pyx_t_10;
    goto __pyx_L14_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_file_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = PyObject_IsInstance(__pyx_v_source, __pyx_t_5); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(6, 1511, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_9 = (__pyx_t_10 != 0);
  __pyx_t_8 = __pyx_t_9;
  __pyx_L14_bool_binop_done:;
  if (likely(__pyx_t_8)) {

    /* "pyarrow/io.pxi":1513
 *     elif file_type is not None and isinstance(source, file_type):
 *         # Python 2 file type
 *         stream = PythonFile(source, 'r')             # <<<<<<<<<<<<<<
 *     else:
 *         raise TypeError("pa.input_stream() called with instance of '{}'"
 */
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_source);
    __Pyx_GIVEREF(__pyx_v_source);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_source);
    __Pyx_INCREF(__pyx_n_u_r);
    __Pyx_GIVEREF(__pyx_n_u_r);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_u_r);
    __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_PythonFile), __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1511
 *     elif isinstance(source, BufferedIOBase):
 *         stream = PythonFile(source, 'r')
 *     elif file_type is not None and isinstance(source, file_type):             # <<<<<<<<<<<<<<
 *         # Python 2 file type
 *         stream = PythonFile(source, 'r')
 */
    goto __pyx_L11;
  }

  /* "pyarrow/io.pxi":1515
 *         stream = PythonFile(source, 'r')
 *     else:
 *         raise TypeError("pa.input_stream() called with instance of '{}'"             # <<<<<<<<<<<<<<
 *                         .format(source.__class__))
 * 
 */
  /*else*/ {

    /* "pyarrow/io.pxi":1516
 *     else:
 *         raise TypeError("pa.input_stream() called with instance of '{}'"
 *                         .format(source.__class__))             # <<<<<<<<<<<<<<
 * 
 *     if compression == 'detect':
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_pa_input_stream_called_with_inst, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_11 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_11)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_6 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_11, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pyarrow/io.pxi":1515
 *         stream = PythonFile(source, 'r')
 *     else:
 *         raise TypeError("pa.input_stream() called with instance of '{}'"             # <<<<<<<<<<<<<<
 *                         .format(source.__class__))
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(6, 1515, __pyx_L1_error)
  }
  __pyx_L11:;

  /* "pyarrow/io.pxi":1518
 *                         .format(source.__class__))
 * 
 *     if compression == 'detect':             # <<<<<<<<<<<<<<
 *         compression = _detect_compression(source_path)
 * 
 */
  __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_compression, __pyx_n_u_detect, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(6, 1518, __pyx_L1_error)
  if (__pyx_t_8) {

    /* "pyarrow/io.pxi":1519
 * 
 *     if compression == 'detect':
 *         compression = _detect_compression(source_path)             # <<<<<<<<<<<<<<
 * 
 *     if buffer_size is not None and buffer_size != 0:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_detect_compression); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1519, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_v_source_path) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_source_path);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1519, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_compression, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "pyarrow/io.pxi":1518
 *                         .format(source.__class__))
 * 
 *     if compression == 'detect':             # <<<<<<<<<<<<<<
 *         compression = _detect_compression(source_path)
 * 
 */
  }

  /* "pyarrow/io.pxi":1521
 *         compression = _detect_compression(source_path)
 * 
 *     if buffer_size is not None and buffer_size != 0:             # <<<<<<<<<<<<<<
 *         stream = BufferedInputStream(stream, buffer_size)
 * 
 */
  __pyx_t_9 = (__pyx_v_buffer_size != Py_None);
  __pyx_t_10 = (__pyx_t_9 != 0);
  if (__pyx_t_10) {
  } else {
    __pyx_t_8 = __pyx_t_10;
    goto __pyx_L18_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_PyInt_NeObjC(__pyx_v_buffer_size, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(6, 1521, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_8 = __pyx_t_10;
  __pyx_L18_bool_binop_done:;
  if (__pyx_t_8) {

    /* "pyarrow/io.pxi":1522
 * 
 *     if buffer_size is not None and buffer_size != 0:
 *         stream = BufferedInputStream(stream, buffer_size)             # <<<<<<<<<<<<<<
 * 
 *     if compression is not None:
 */
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1522, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(((PyObject *)__pyx_v_stream));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_stream));
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_stream));
    __Pyx_INCREF(__pyx_v_buffer_size);
    __Pyx_GIVEREF(__pyx_v_buffer_size);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_buffer_size);
    __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_BufferedInputStream), __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1522, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_stream, ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1521
 *         compression = _detect_compression(source_path)
 * 
 *     if buffer_size is not None and buffer_size != 0:             # <<<<<<<<<<<<<<
 *         stream = BufferedInputStream(stream, buffer_size)
 * 
 */
  }

  /* "pyarrow/io.pxi":1524
 *         stream = BufferedInputStream(stream, buffer_size)
 * 
 *     if compression is not None:             # <<<<<<<<<<<<<<
 *         stream = CompressedInputStream(stream, compression)
 * 
 */
  __pyx_t_8 = (__pyx_v_compression != Py_None);
  __pyx_t_10 = (__pyx_t_8 != 0);
  if (__pyx_t_10) {

    /* "pyarrow/io.pxi":1525
 * 
 *     if compression is not None:
 *         stream = CompressedInputStream(stream, compression)             # <<<<<<<<<<<<<<
 * 
 *     return stream
 */
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1525, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(((PyObject *)__pyx_v_stream));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_stream));
    PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_stream));
    __Pyx_INCREF(__pyx_v_compression);
    __Pyx_GIVEREF(__pyx_v_compression);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_compression);
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_CompressedInputStream), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1525, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_stream, ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "pyarrow/io.pxi":1524
 *         stream = BufferedInputStream(stream, buffer_size)
 * 
 *     if compression is not None:             # <<<<<<<<<<<<<<
 *         stream = CompressedInputStream(stream, compression)
 * 
 */
  }

  /* "pyarrow/io.pxi":1527
 *         stream = CompressedInputStream(stream, compression)
 * 
 *     return stream             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_stream));
  __pyx_r = ((PyObject *)__pyx_v_stream);
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1478
 * 
 * 
 * def input_stream(source, compression='detect', buffer_size=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create an Arrow input stream.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("pyarrow.lib.input_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_stream);
  __Pyx_XDECREF(__pyx_v_source_path);
  __Pyx_XDECREF(__pyx_v_compression);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1530
 * 
 * 
 * def output_stream(source, compression='detect', buffer_size=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create an Arrow output stream.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_131output_stream(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_130output_stream[] = "output_stream(source, compression=u'detect', buffer_size=None)\n\n    Create an Arrow output stream.\n\n    Parameters\n    ----------\n    source: str, Path, buffer, file-like object, ...\n        The source to open for writing\n    compression: str or None\n        The compression algorithm to use for on-the-fly compression.\n        If \"detect\" and source is a file path, then compression will be\n        chosen based on the file extension.\n        If None, no compression will be applied.\n        Otherwise, a well-known algorithm name must be supplied (e.g. \"gzip\")\n    buffer_size: int, default None\n        If None or 0, no buffering will happen.  Otherwise the size of the\n        temporary write buffer.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_131output_stream = {"output_stream", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_131output_stream, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_130output_stream};
static PyObject *__pyx_pw_7pyarrow_3lib_131output_stream(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_source = 0;
  PyObject *__pyx_v_compression = 0;
  PyObject *__pyx_v_buffer_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("output_stream (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_compression,&__pyx_n_s_buffer_size,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_n_u_detect);
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_compression);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer_size);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "output_stream") < 0)) __PYX_ERR(6, 1530, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_source = values[0];
    __pyx_v_compression = values[1];
    __pyx_v_buffer_size = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("output_stream", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1530, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.output_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_130output_stream(__pyx_self, __pyx_v_source, __pyx_v_compression, __pyx_v_buffer_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_130output_stream(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_compression, PyObject *__pyx_v_buffer_size) {
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream = 0;
  PyObject *__pyx_v_source_path = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("output_stream", 0);
  __Pyx_INCREF(__pyx_v_compression);

  /* "pyarrow/io.pxi":1550
 *     cdef NativeFile stream
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "pyarrow/io.pxi":1551
 * 
 *     try:
 *         source_path = _stringify_path(source)             # <<<<<<<<<<<<<<
 *     except TypeError:
 *         source_path = None
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_stringify_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1551, __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(6, 1551, __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":1550
 *     cdef NativeFile stream
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1552
 *     try:
 *         source_path = _stringify_path(source)
 *     except TypeError:             # <<<<<<<<<<<<<<
 *         source_path = None
 * 
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pyarrow.lib.output_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(6, 1552, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "pyarrow/io.pxi":1553
 *         source_path = _stringify_path(source)
 *     except TypeError:
 *         source_path = None             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(source, NativeFile):
 */
      __Pyx_INCREF(Py_None);
      __Pyx_XDECREF_SET(__pyx_v_source_path, Py_None);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/io.pxi":1550
 *     cdef NativeFile stream
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "pyarrow/io.pxi":1555
 *         source_path = None
 * 
 *     if isinstance(source, NativeFile):             # <<<<<<<<<<<<<<
 *         stream = source
 *     elif source_path is not None:
 */
  __pyx_t_8 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile); 
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "pyarrow/io.pxi":1556
 * 
 *     if isinstance(source, NativeFile):
 *         stream = source             # <<<<<<<<<<<<<<
 *     elif source_path is not None:
 *         stream = OSFile(source_path, 'w')
 */
    if (!(likely(((__pyx_v_source) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile))))) __PYX_ERR(6, 1556, __pyx_L1_error)
    __pyx_t_6 = __pyx_v_source;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1555
 *         source_path = None
 * 
 *     if isinstance(source, NativeFile):             # <<<<<<<<<<<<<<
 *         stream = source
 *     elif source_path is not None:
 */
    goto __pyx_L11;
  }

  /* "pyarrow/io.pxi":1557
 *     if isinstance(source, NativeFile):
 *         stream = source
 *     elif source_path is not None:             # <<<<<<<<<<<<<<
 *         stream = OSFile(source_path, 'w')
 *     elif isinstance(source, (Buffer, memoryview)):
 */
  __pyx_t_9 = (__pyx_v_source_path != Py_None);
  __pyx_t_8 = (__pyx_t_9 != 0);
  if (__pyx_t_8) {

    /* "pyarrow/io.pxi":1558
 *         stream = source
 *     elif source_path is not None:
 *         stream = OSFile(source_path, 'w')             # <<<<<<<<<<<<<<
 *     elif isinstance(source, (Buffer, memoryview)):
 *         stream = FixedSizeBufferWriter(as_buffer(source))
 */
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1558, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_source_path);
    __Pyx_GIVEREF(__pyx_v_source_path);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_source_path);
    __Pyx_INCREF(__pyx_n_u_w);
    __Pyx_GIVEREF(__pyx_n_u_w);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_u_w);
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_OSFile), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1558, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "pyarrow/io.pxi":1557
 *     if isinstance(source, NativeFile):
 *         stream = source
 *     elif source_path is not None:             # <<<<<<<<<<<<<<
 *         stream = OSFile(source_path, 'w')
 *     elif isinstance(source, (Buffer, memoryview)):
 */
    goto __pyx_L11;
  }

  /* "pyarrow/io.pxi":1559
 *     elif source_path is not None:
 *         stream = OSFile(source_path, 'w')
 *     elif isinstance(source, (Buffer, memoryview)):             # <<<<<<<<<<<<<<
 *         stream = FixedSizeBufferWriter(as_buffer(source))
 *     elif isinstance(source, BufferedIOBase):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_memoryview); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_9 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_Buffer); 
  __pyx_t_10 = (__pyx_t_9 != 0);
  if (!__pyx_t_10) {
  } else {
    __pyx_t_8 = __pyx_t_10;
    goto __pyx_L12_bool_binop_done;
  }
  __pyx_t_10 = PyObject_IsInstance(__pyx_v_source, __pyx_t_5); 
  __pyx_t_9 = (__pyx_t_10 != 0);
  __pyx_t_8 = __pyx_t_9;
  __pyx_L12_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "pyarrow/io.pxi":1560
 *         stream = OSFile(source_path, 'w')
 *     elif isinstance(source, (Buffer, memoryview)):
 *         stream = FixedSizeBufferWriter(as_buffer(source))             # <<<<<<<<<<<<<<
 *     elif isinstance(source, BufferedIOBase):
 *         stream = PythonFile(source, 'w')
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_as_buffer); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1560, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_source);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1560, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_FixedSizeBufferWriter), __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1560, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1559
 *     elif source_path is not None:
 *         stream = OSFile(source_path, 'w')
 *     elif isinstance(source, (Buffer, memoryview)):             # <<<<<<<<<<<<<<
 *         stream = FixedSizeBufferWriter(as_buffer(source))
 *     elif isinstance(source, BufferedIOBase):
 */
    goto __pyx_L11;
  }

  /* "pyarrow/io.pxi":1561
 *     elif isinstance(source, (Buffer, memoryview)):
 *         stream = FixedSizeBufferWriter(as_buffer(source))
 *     elif isinstance(source, BufferedIOBase):             # <<<<<<<<<<<<<<
 *         stream = PythonFile(source, 'w')
 *     elif file_type is not None and isinstance(source, file_type):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_BufferedIOBase); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_9 = PyObject_IsInstance(__pyx_v_source, __pyx_t_6); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(6, 1561, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = (__pyx_t_9 != 0);
  if (__pyx_t_8) {

    /* "pyarrow/io.pxi":1562
 *         stream = FixedSizeBufferWriter(as_buffer(source))
 *     elif isinstance(source, BufferedIOBase):
 *         stream = PythonFile(source, 'w')             # <<<<<<<<<<<<<<
 *     elif file_type is not None and isinstance(source, file_type):
 *         # Python 2 file type
 */
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1562, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_source);
    __Pyx_GIVEREF(__pyx_v_source);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_source);
    __Pyx_INCREF(__pyx_n_u_w);
    __Pyx_GIVEREF(__pyx_n_u_w);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_u_w);
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_PythonFile), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1562, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "pyarrow/io.pxi":1561
 *     elif isinstance(source, (Buffer, memoryview)):
 *         stream = FixedSizeBufferWriter(as_buffer(source))
 *     elif isinstance(source, BufferedIOBase):             # <<<<<<<<<<<<<<
 *         stream = PythonFile(source, 'w')
 *     elif file_type is not None and isinstance(source, file_type):
 */
    goto __pyx_L11;
  }

  /* "pyarrow/io.pxi":1563
 *     elif isinstance(source, BufferedIOBase):
 *         stream = PythonFile(source, 'w')
 *     elif file_type is not None and isinstance(source, file_type):             # <<<<<<<<<<<<<<
 *         # Python 2 file type
 *         stream = PythonFile(source, 'w')
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_file_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_9 = (__pyx_t_5 != Py_None);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_10 = (__pyx_t_9 != 0);
  if (__pyx_t_10) {
  } else {
    __pyx_t_8 = __pyx_t_10;
    goto __pyx_L14_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_file_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = PyObject_IsInstance(__pyx_v_source, __pyx_t_5); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(6, 1563, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_9 = (__pyx_t_10 != 0);
  __pyx_t_8 = __pyx_t_9;
  __pyx_L14_bool_binop_done:;
  if (likely(__pyx_t_8)) {

    /* "pyarrow/io.pxi":1565
 *     elif file_type is not None and isinstance(source, file_type):
 *         # Python 2 file type
 *         stream = PythonFile(source, 'w')             # <<<<<<<<<<<<<<
 *     else:
 *         raise TypeError("pa.output_stream() called with instance of '{}'"
 */
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1565, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_source);
    __Pyx_GIVEREF(__pyx_v_source);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_source);
    __Pyx_INCREF(__pyx_n_u_w);
    __Pyx_GIVEREF(__pyx_n_u_w);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_u_w);
    __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_PythonFile), __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1565, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1563
 *     elif isinstance(source, BufferedIOBase):
 *         stream = PythonFile(source, 'w')
 *     elif file_type is not None and isinstance(source, file_type):             # <<<<<<<<<<<<<<
 *         # Python 2 file type
 *         stream = PythonFile(source, 'w')
 */
    goto __pyx_L11;
  }

  /* "pyarrow/io.pxi":1567
 *         stream = PythonFile(source, 'w')
 *     else:
 *         raise TypeError("pa.output_stream() called with instance of '{}'"             # <<<<<<<<<<<<<<
 *                         .format(source.__class__))
 * 
 */
  /*else*/ {

    /* "pyarrow/io.pxi":1568
 *     else:
 *         raise TypeError("pa.output_stream() called with instance of '{}'"
 *                         .format(source.__class__))             # <<<<<<<<<<<<<<
 * 
 *     if compression == 'detect':
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_pa_output_stream_called_with_ins, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1568, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1568, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_11 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_11)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_6 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_11, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1568, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pyarrow/io.pxi":1567
 *         stream = PythonFile(source, 'w')
 *     else:
 *         raise TypeError("pa.output_stream() called with instance of '{}'"             # <<<<<<<<<<<<<<
 *                         .format(source.__class__))
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1567, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(6, 1567, __pyx_L1_error)
  }
  __pyx_L11:;

  /* "pyarrow/io.pxi":1570
 *                         .format(source.__class__))
 * 
 *     if compression == 'detect':             # <<<<<<<<<<<<<<
 *         compression = _detect_compression(source_path)
 * 
 */
  __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_compression, __pyx_n_u_detect, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(6, 1570, __pyx_L1_error)
  if (__pyx_t_8) {

    /* "pyarrow/io.pxi":1571
 * 
 *     if compression == 'detect':
 *         compression = _detect_compression(source_path)             # <<<<<<<<<<<<<<
 * 
 *     if buffer_size is not None and buffer_size != 0:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_detect_compression); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1571, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_v_source_path) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_source_path);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1571, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_compression, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "pyarrow/io.pxi":1570
 *                         .format(source.__class__))
 * 
 *     if compression == 'detect':             # <<<<<<<<<<<<<<
 *         compression = _detect_compression(source_path)
 * 
 */
  }

  /* "pyarrow/io.pxi":1573
 *         compression = _detect_compression(source_path)
 * 
 *     if buffer_size is not None and buffer_size != 0:             # <<<<<<<<<<<<<<
 *         stream = BufferedOutputStream(stream, buffer_size)
 * 
 */
  __pyx_t_9 = (__pyx_v_buffer_size != Py_None);
  __pyx_t_10 = (__pyx_t_9 != 0);
  if (__pyx_t_10) {
  } else {
    __pyx_t_8 = __pyx_t_10;
    goto __pyx_L18_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_PyInt_NeObjC(__pyx_v_buffer_size, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(6, 1573, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_8 = __pyx_t_10;
  __pyx_L18_bool_binop_done:;
  if (__pyx_t_8) {

    /* "pyarrow/io.pxi":1574
 * 
 *     if buffer_size is not None and buffer_size != 0:
 *         stream = BufferedOutputStream(stream, buffer_size)             # <<<<<<<<<<<<<<
 * 
 *     if compression is not None:
 */
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1574, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(((PyObject *)__pyx_v_stream));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_stream));
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_stream));
    __Pyx_INCREF(__pyx_v_buffer_size);
    __Pyx_GIVEREF(__pyx_v_buffer_size);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_buffer_size);
    __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_BufferedOutputStream), __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1574, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_stream, ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1573
 *         compression = _detect_compression(source_path)
 * 
 *     if buffer_size is not None and buffer_size != 0:             # <<<<<<<<<<<<<<
 *         stream = BufferedOutputStream(stream, buffer_size)
 * 
 */
  }

  /* "pyarrow/io.pxi":1576
 *         stream = BufferedOutputStream(stream, buffer_size)
 * 
 *     if compression is not None:             # <<<<<<<<<<<<<<
 *         stream = CompressedOutputStream(stream, compression)
 * 
 */
  __pyx_t_8 = (__pyx_v_compression != Py_None);
  __pyx_t_10 = (__pyx_t_8 != 0);
  if (__pyx_t_10) {

    /* "pyarrow/io.pxi":1577
 * 
 *     if compression is not None:
 *         stream = CompressedOutputStream(stream, compression)             # <<<<<<<<<<<<<<
 * 
 *     return stream
 */
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1577, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(((PyObject *)__pyx_v_stream));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_stream));
    PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_stream));
    __Pyx_INCREF(__pyx_v_compression);
    __Pyx_GIVEREF(__pyx_v_compression);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_compression);
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_CompressedOutputStream), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1577, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_stream, ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "pyarrow/io.pxi":1576
 *         stream = BufferedOutputStream(stream, buffer_size)
 * 
 *     if compression is not None:             # <<<<<<<<<<<<<<
 *         stream = CompressedOutputStream(stream, compression)
 * 
 */
  }

  /* "pyarrow/io.pxi":1579
 *         stream = CompressedOutputStream(stream, compression)
 * 
 *     return stream             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_stream));
  __pyx_r = ((PyObject *)__pyx_v_stream);
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1530
 * 
 * 
 * def output_stream(source, compression='detect', buffer_size=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create an Arrow output stream.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("pyarrow.lib.output_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_stream);
  __Pyx_XDECREF(__pyx_v_source_path);
  __Pyx_XDECREF(__pyx_v_compression);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":30
 * 
 * 
 * def have_libhdfs():             # <<<<<<<<<<<<<<
 *     try:
 *         with nogil:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_133have_libhdfs(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_132have_libhdfs[] = "have_libhdfs()";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_133have_libhdfs = {"have_libhdfs", (PyCFunction)__pyx_pw_7pyarrow_3lib_133have_libhdfs, METH_NOARGS, __pyx_doc_7pyarrow_3lib_132have_libhdfs};
static PyObject *__pyx_pw_7pyarrow_3lib_133have_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_132have_libhdfs(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_132have_libhdfs(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("have_libhdfs", 0);

  /* "pyarrow/io-hdfs.pxi":31
 * 
 * def have_libhdfs():
 *     try:             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(HaveLibHdfs())
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "pyarrow/io-hdfs.pxi":32
 * def have_libhdfs():
 *     try:
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(HaveLibHdfs())
 *         return True
 */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          __Pyx_FastGIL_Remember();
          #endif
          /*try:*/ {

            /* "pyarrow/io-hdfs.pxi":33
 *     try:
 *         with nogil:
 *             check_status(HaveLibHdfs())             # <<<<<<<<<<<<<<
 *         return True
 *     except Exception:
 */
            __pyx_t_4 = __pyx_f_7pyarrow_3lib_check_status(arrow::io::HaveLibHdfs()); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 33, __pyx_L10_error)
          }

          /* "pyarrow/io-hdfs.pxi":32
 * def have_libhdfs():
 *     try:
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(HaveLibHdfs())
 *         return True
 */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              __Pyx_FastGIL_Forget();
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L11;
            }
            __pyx_L10_error: {
              #ifdef WITH_THREAD
              __Pyx_FastGIL_Forget();
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L3_error;
            }
            __pyx_L11:;
          }
      }

      /* "pyarrow/io-hdfs.pxi":34
 *         with nogil:
 *             check_status(HaveLibHdfs())
 *         return True             # <<<<<<<<<<<<<<
 *     except Exception:
 *         return False
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      goto __pyx_L7_try_return;

      /* "pyarrow/io-hdfs.pxi":31
 * 
 * def have_libhdfs():
 *     try:             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(HaveLibHdfs())
 */
    }
    __pyx_L3_error:;

    /* "pyarrow/io-hdfs.pxi":35
 *             check_status(HaveLibHdfs())
 *         return True
 *     except Exception:             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("pyarrow.lib.have_libhdfs", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 35, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "pyarrow/io-hdfs.pxi":36
 *         return True
 *     except Exception:
 *         return False             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/io-hdfs.pxi":31
 * 
 * def have_libhdfs():
 *     try:             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(HaveLibHdfs())
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "pyarrow/io-hdfs.pxi":30
 * 
 * 
 * def have_libhdfs():             # <<<<<<<<<<<<<<
 *     try:
 *         with nogil:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.have_libhdfs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":39
 * 
 * 
 * def have_libhdfs3():             # <<<<<<<<<<<<<<
 *     try:
 *         with nogil:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_135have_libhdfs3(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_134have_libhdfs3[] = "have_libhdfs3()";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_135have_libhdfs3 = {"have_libhdfs3", (PyCFunction)__pyx_pw_7pyarrow_3lib_135have_libhdfs3, METH_NOARGS, __pyx_doc_7pyarrow_3lib_134have_libhdfs3};
static PyObject *__pyx_pw_7pyarrow_3lib_135have_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_134have_libhdfs3(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_134have_libhdfs3(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("have_libhdfs3", 0);

  /* "pyarrow/io-hdfs.pxi":40
 * 
 * def have_libhdfs3():
 *     try:             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(HaveLibHdfs3())
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "pyarrow/io-hdfs.pxi":41
 * def have_libhdfs3():
 *     try:
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(HaveLibHdfs3())
 *         return True
 */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          __Pyx_FastGIL_Remember();
          #endif
          /*try:*/ {

            /* "pyarrow/io-hdfs.pxi":42
 *     try:
 *         with nogil:
 *             check_status(HaveLibHdfs3())             # <<<<<<<<<<<<<<
 *         return True
 *     except Exception:
 */
            __pyx_t_4 = __pyx_f_7pyarrow_3lib_check_status(arrow::io::HaveLibHdfs3()); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 42, __pyx_L10_error)
          }

          /* "pyarrow/io-hdfs.pxi":41
 * def have_libhdfs3():
 *     try:
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(HaveLibHdfs3())
 *         return True
 */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              __Pyx_FastGIL_Forget();
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L11;
            }
            __pyx_L10_error: {
              #ifdef WITH_THREAD
              __Pyx_FastGIL_Forget();
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L3_error;
            }
            __pyx_L11:;
          }
      }

      /* "pyarrow/io-hdfs.pxi":43
 *         with nogil:
 *             check_status(HaveLibHdfs3())
 *         return True             # <<<<<<<<<<<<<<
 *     except Exception:
 *         return False
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      goto __pyx_L7_try_return;

      /* "pyarrow/io-hdfs.pxi":40
 * 
 * def have_libhdfs3():
 *     try:             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(HaveLibHdfs3())
 */
    }
    __pyx_L3_error:;

    /* "pyarrow/io-hdfs.pxi":44
 *             check_status(HaveLibHdfs3())
 *         return True
 *     except Exception:             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("pyarrow.lib.have_libhdfs3", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 44, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "pyarrow/io-hdfs.pxi":45
 *         return True
 *     except Exception:
 *         return False             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/io-hdfs.pxi":40
 * 
 * def have_libhdfs3():
 *     try:             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(HaveLibHdfs3())
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "pyarrow/io-hdfs.pxi":39
 * 
 * 
 * def have_libhdfs3():             # <<<<<<<<<<<<<<
 *     try:
 *         with nogil:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.have_libhdfs3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":48
 * 
 * 
 * def strip_hdfs_abspath(path):             # <<<<<<<<<<<<<<
 *     m = _HDFS_PATH_RE.match(path)
 *     if m:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_137strip_hdfs_abspath(PyObject *__pyx_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_7pyarrow_3lib_136strip_hdfs_abspath[] = "strip_hdfs_abspath(path)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_137strip_hdfs_abspath = {"strip_hdfs_abspath", (PyCFunction)__pyx_pw_7pyarrow_3lib_137strip_hdfs_abspath, METH_O, __pyx_doc_7pyarrow_3lib_136strip_hdfs_abspath};
static PyObject *__pyx_pw_7pyarrow_3lib_137strip_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_136strip_hdfs_abspath(__pyx_self, ((PyObject *)__pyx_v_path));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_136strip_hdfs_abspath(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("strip_hdfs_abspath", 0);

  /* "pyarrow/io-hdfs.pxi":49
 * 
 * def strip_hdfs_abspath(path):
 *     m = _HDFS_PATH_RE.match(path)             # <<<<<<<<<<<<<<
 *     if m:
 *         return m.group(3)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_HDFS_PATH_RE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_match); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_m = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":50
 * def strip_hdfs_abspath(path):
 *     m = _HDFS_PATH_RE.match(path)
 *     if m:             # <<<<<<<<<<<<<<
 *         return m.group(3)
 *     else:
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_m); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 50, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "pyarrow/io-hdfs.pxi":51
 *     m = _HDFS_PATH_RE.match(path)
 *     if m:
 *         return m.group(3)             # <<<<<<<<<<<<<<
 *     else:
 *         return path
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_group); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 51, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_int_3);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 51, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "pyarrow/io-hdfs.pxi":50
 * def strip_hdfs_abspath(path):
 *     m = _HDFS_PATH_RE.match(path)
 *     if m:             # <<<<<<<<<<<<<<
 *         return m.group(3)
 *     else:
 */
  }

  /* "pyarrow/io-hdfs.pxi":53
 *         return m.group(3)
 *     else:
 *         return path             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_path);
    __pyx_r = __pyx_v_path;
    goto __pyx_L0;
  }

  /* "pyarrow/io-hdfs.pxi":48
 * 
 * 
 * def strip_hdfs_abspath(path):             # <<<<<<<<<<<<<<
 *     m = _HDFS_PATH_RE.match(path)
 *     if m:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.strip_hdfs_abspath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":69
 *         dict extra_conf
 * 
 *     def _connect(self, host, port, user, kerb_ticket, driver, extra_conf):             # <<<<<<<<<<<<<<
 *         cdef HdfsConnectionConfig conf
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_1_connect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem__connect[] = "HadoopFileSystem._connect(self, host, port, user, kerb_ticket, driver, extra_conf)";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_1_connect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_host = 0;
  PyObject *__pyx_v_port = 0;
  PyObject *__pyx_v_user = 0;
  PyObject *__pyx_v_kerb_ticket = 0;
  PyObject *__pyx_v_driver = 0;
  PyObject *__pyx_v_extra_conf = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_connect (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_host,&__pyx_n_s_port,&__pyx_n_s_user,&__pyx_n_s_kerb_ticket,&__pyx_n_s_driver,&__pyx_n_s_extra_conf,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_host)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_port)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_connect", 1, 6, 6, 1); __PYX_ERR(2, 69, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_user)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_connect", 1, 6, 6, 2); __PYX_ERR(2, 69, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kerb_ticket)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_connect", 1, 6, 6, 3); __PYX_ERR(2, 69, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_driver)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_connect", 1, 6, 6, 4); __PYX_ERR(2, 69, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extra_conf)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_connect", 1, 6, 6, 5); __PYX_ERR(2, 69, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_connect") < 0)) __PYX_ERR(2, 69, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_host = values[0];
    __pyx_v_port = values[1];
    __pyx_v_user = values[2];
    __pyx_v_kerb_ticket = values[3];
    __pyx_v_driver = values[4];
    __pyx_v_extra_conf = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_connect", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 69, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem._connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem__connect(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), __pyx_v_host, __pyx_v_port, __pyx_v_user, __pyx_v_kerb_ticket, __pyx_v_driver, __pyx_v_extra_conf);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem__connect(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_host, PyObject *__pyx_v_port, PyObject *__pyx_v_user, PyObject *__pyx_v_kerb_ticket, PyObject *__pyx_v_driver, PyObject *__pyx_v_extra_conf) {
  arrow::io::HdfsConnectionConfig __pyx_v_conf;
  PyObject *__pyx_9genexpr14__pyx_v_k = NULL;
  PyObject *__pyx_9genexpr14__pyx_v_v = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  std::unordered_map<std::string,std::string>  __pyx_t_15;
  __Pyx_RefNannySetupContext("_connect", 0);

  /* "pyarrow/io-hdfs.pxi":72
 *         cdef HdfsConnectionConfig conf
 * 
 *         if host is not None:             # <<<<<<<<<<<<<<
 *             conf.host = tobytes(host)
 *         self.host = host
 */
  __pyx_t_1 = (__pyx_v_host != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/io-hdfs.pxi":73
 * 
 *         if host is not None:
 *             conf.host = tobytes(host)             # <<<<<<<<<<<<<<
 *         self.host = host
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 73, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_host) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_host);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 73, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 73, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_conf.host = __pyx_t_6;

    /* "pyarrow/io-hdfs.pxi":72
 *         cdef HdfsConnectionConfig conf
 * 
 *         if host is not None:             # <<<<<<<<<<<<<<
 *             conf.host = tobytes(host)
 *         self.host = host
 */
  }

  /* "pyarrow/io-hdfs.pxi":74
 *         if host is not None:
 *             conf.host = tobytes(host)
 *         self.host = host             # <<<<<<<<<<<<<<
 * 
 *         conf.port = port
 */
  __Pyx_INCREF(__pyx_v_host);
  __Pyx_GIVEREF(__pyx_v_host);
  __Pyx_GOTREF(__pyx_v_self->host);
  __Pyx_DECREF(__pyx_v_self->host);
  __pyx_v_self->host = __pyx_v_host;

  /* "pyarrow/io-hdfs.pxi":76
 *         self.host = host
 * 
 *         conf.port = port             # <<<<<<<<<<<<<<
 *         self.port = port
 * 
 */
  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_port); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 76, __pyx_L1_error)
  __pyx_v_conf.port = __pyx_t_7;

  /* "pyarrow/io-hdfs.pxi":77
 * 
 *         conf.port = port
 *         self.port = port             # <<<<<<<<<<<<<<
 * 
 *         if user is not None:
 */
  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_port); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 77, __pyx_L1_error)
  __pyx_v_self->port = __pyx_t_7;

  /* "pyarrow/io-hdfs.pxi":79
 *         self.port = port
 * 
 *         if user is not None:             # <<<<<<<<<<<<<<
 *             conf.user = tobytes(user)
 *         self.user = user
 */
  __pyx_t_2 = (__pyx_v_user != Py_None);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io-hdfs.pxi":80
 * 
 *         if user is not None:
 *             conf.user = tobytes(user)             # <<<<<<<<<<<<<<
 *         self.user = user
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 80, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_user) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_user);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 80, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 80, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_conf.user = __pyx_t_6;

    /* "pyarrow/io-hdfs.pxi":79
 *         self.port = port
 * 
 *         if user is not None:             # <<<<<<<<<<<<<<
 *             conf.user = tobytes(user)
 *         self.user = user
 */
  }

  /* "pyarrow/io-hdfs.pxi":81
 *         if user is not None:
 *             conf.user = tobytes(user)
 *         self.user = user             # <<<<<<<<<<<<<<
 * 
 *         if kerb_ticket is not None:
 */
  __Pyx_INCREF(__pyx_v_user);
  __Pyx_GIVEREF(__pyx_v_user);
  __Pyx_GOTREF(__pyx_v_self->user);
  __Pyx_DECREF(__pyx_v_self->user);
  __pyx_v_self->user = __pyx_v_user;

  /* "pyarrow/io-hdfs.pxi":83
 *         self.user = user
 * 
 *         if kerb_ticket is not None:             # <<<<<<<<<<<<<<
 *             conf.kerb_ticket = tobytes(kerb_ticket)
 *         self.kerb_ticket = kerb_ticket
 */
  __pyx_t_1 = (__pyx_v_kerb_ticket != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/io-hdfs.pxi":84
 * 
 *         if kerb_ticket is not None:
 *             conf.kerb_ticket = tobytes(kerb_ticket)             # <<<<<<<<<<<<<<
 *         self.kerb_ticket = kerb_ticket
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 84, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_kerb_ticket) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_kerb_ticket);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 84, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 84, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_conf.kerb_ticket = __pyx_t_6;

    /* "pyarrow/io-hdfs.pxi":83
 *         self.user = user
 * 
 *         if kerb_ticket is not None:             # <<<<<<<<<<<<<<
 *             conf.kerb_ticket = tobytes(kerb_ticket)
 *         self.kerb_ticket = kerb_ticket
 */
  }

  /* "pyarrow/io-hdfs.pxi":85
 *         if kerb_ticket is not None:
 *             conf.kerb_ticket = tobytes(kerb_ticket)
 *         self.kerb_ticket = kerb_ticket             # <<<<<<<<<<<<<<
 * 
 *         if driver == 'libhdfs':
 */
  __Pyx_INCREF(__pyx_v_kerb_ticket);
  __Pyx_GIVEREF(__pyx_v_kerb_ticket);
  __Pyx_GOTREF(__pyx_v_self->kerb_ticket);
  __Pyx_DECREF(__pyx_v_self->kerb_ticket);
  __pyx_v_self->kerb_ticket = __pyx_v_kerb_ticket;

  /* "pyarrow/io-hdfs.pxi":87
 *         self.kerb_ticket = kerb_ticket
 * 
 *         if driver == 'libhdfs':             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(HaveLibHdfs())
 */
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_driver, __pyx_n_u_libhdfs, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 87, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "pyarrow/io-hdfs.pxi":88
 * 
 *         if driver == 'libhdfs':
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(HaveLibHdfs())
 *             conf.driver = HdfsDriver_LIBHDFS
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/io-hdfs.pxi":89
 *         if driver == 'libhdfs':
 *             with nogil:
 *                 check_status(HaveLibHdfs())             # <<<<<<<<<<<<<<
 *             conf.driver = HdfsDriver_LIBHDFS
 *         elif driver == 'libhdfs3':
 */
          __pyx_t_7 = __pyx_f_7pyarrow_3lib_check_status(arrow::io::HaveLibHdfs()); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 89, __pyx_L8_error)
        }

        /* "pyarrow/io-hdfs.pxi":88
 * 
 *         if driver == 'libhdfs':
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(HaveLibHdfs())
 *             conf.driver = HdfsDriver_LIBHDFS
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L9;
          }
          __pyx_L8_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L9:;
        }
    }

    /* "pyarrow/io-hdfs.pxi":90
 *             with nogil:
 *                 check_status(HaveLibHdfs())
 *             conf.driver = HdfsDriver_LIBHDFS             # <<<<<<<<<<<<<<
 *         elif driver == 'libhdfs3':
 *             with nogil:
 */
    __pyx_v_conf.driver =  arrow::io::HdfsDriver::LIBHDFS;

    /* "pyarrow/io-hdfs.pxi":87
 *         self.kerb_ticket = kerb_ticket
 * 
 *         if driver == 'libhdfs':             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(HaveLibHdfs())
 */
    goto __pyx_L6;
  }

  /* "pyarrow/io-hdfs.pxi":91
 *                 check_status(HaveLibHdfs())
 *             conf.driver = HdfsDriver_LIBHDFS
 *         elif driver == 'libhdfs3':             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(HaveLibHdfs3())
 */
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_driver, __pyx_n_u_libhdfs3, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 91, __pyx_L1_error)
  if (likely(__pyx_t_2)) {

    /* "pyarrow/io-hdfs.pxi":92
 *             conf.driver = HdfsDriver_LIBHDFS
 *         elif driver == 'libhdfs3':
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(HaveLibHdfs3())
 *             conf.driver = HdfsDriver_LIBHDFS3
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/io-hdfs.pxi":93
 *         elif driver == 'libhdfs3':
 *             with nogil:
 *                 check_status(HaveLibHdfs3())             # <<<<<<<<<<<<<<
 *             conf.driver = HdfsDriver_LIBHDFS3
 *         else:
 */
          __pyx_t_7 = __pyx_f_7pyarrow_3lib_check_status(arrow::io::HaveLibHdfs3()); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 93, __pyx_L11_error)
        }

        /* "pyarrow/io-hdfs.pxi":92
 *             conf.driver = HdfsDriver_LIBHDFS
 *         elif driver == 'libhdfs3':
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(HaveLibHdfs3())
 *             conf.driver = HdfsDriver_LIBHDFS3
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L12;
          }
          __pyx_L11_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L12:;
        }
    }

    /* "pyarrow/io-hdfs.pxi":94
 *             with nogil:
 *                 check_status(HaveLibHdfs3())
 *             conf.driver = HdfsDriver_LIBHDFS3             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError("unknown driver: %r" % driver)
 */
    __pyx_v_conf.driver =  arrow::io::HdfsDriver::LIBHDFS3;

    /* "pyarrow/io-hdfs.pxi":91
 *                 check_status(HaveLibHdfs())
 *             conf.driver = HdfsDriver_LIBHDFS
 *         elif driver == 'libhdfs3':             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(HaveLibHdfs3())
 */
    goto __pyx_L6;
  }

  /* "pyarrow/io-hdfs.pxi":96
 *             conf.driver = HdfsDriver_LIBHDFS3
 *         else:
 *             raise ValueError("unknown driver: %r" % driver)             # <<<<<<<<<<<<<<
 *         self.driver = driver
 * 
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_driver_r, __pyx_v_driver); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 96, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 96, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(2, 96, __pyx_L1_error)
  }
  __pyx_L6:;

  /* "pyarrow/io-hdfs.pxi":97
 *         else:
 *             raise ValueError("unknown driver: %r" % driver)
 *         self.driver = driver             # <<<<<<<<<<<<<<
 * 
 *         if extra_conf is not None and isinstance(extra_conf, dict):
 */
  __Pyx_INCREF(__pyx_v_driver);
  __Pyx_GIVEREF(__pyx_v_driver);
  __Pyx_GOTREF(__pyx_v_self->driver);
  __Pyx_DECREF(__pyx_v_self->driver);
  __pyx_v_self->driver = __pyx_v_driver;

  /* "pyarrow/io-hdfs.pxi":99
 *         self.driver = driver
 * 
 *         if extra_conf is not None and isinstance(extra_conf, dict):             # <<<<<<<<<<<<<<
 *             conf.extra_conf = {tobytes(k): tobytes(v)
 *                                for k, v in extra_conf.items()}
 */
  __pyx_t_1 = (__pyx_v_extra_conf != Py_None);
  __pyx_t_8 = (__pyx_t_1 != 0);
  if (__pyx_t_8) {
  } else {
    __pyx_t_2 = __pyx_t_8;
    goto __pyx_L14_bool_binop_done;
  }
  __pyx_t_8 = PyDict_Check(__pyx_v_extra_conf); 
  __pyx_t_1 = (__pyx_t_8 != 0);
  __pyx_t_2 = __pyx_t_1;
  __pyx_L14_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pyarrow/io-hdfs.pxi":100
 * 
 *         if extra_conf is not None and isinstance(extra_conf, dict):
 *             conf.extra_conf = {tobytes(k): tobytes(v)             # <<<<<<<<<<<<<<
 *                                for k, v in extra_conf.items()}
 *         self.extra_conf = extra_conf
 */
    { /* enter inner scope */
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 100, __pyx_L18_error)
      __Pyx_GOTREF(__pyx_t_4);

      /* "pyarrow/io-hdfs.pxi":101
 *         if extra_conf is not None and isinstance(extra_conf, dict):
 *             conf.extra_conf = {tobytes(k): tobytes(v)
 *                                for k, v in extra_conf.items()}             # <<<<<<<<<<<<<<
 *         self.extra_conf = extra_conf
 * 
 */
      __pyx_t_9 = 0;
      if (unlikely(__pyx_v_extra_conf == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
        __PYX_ERR(2, 101, __pyx_L18_error)
      }
      __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_extra_conf, 0, __pyx_n_s_items, (&__pyx_t_10), (&__pyx_t_7)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 101, __pyx_L18_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3);
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_5 = 0;
      while (1) {
        __pyx_t_12 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_10, &__pyx_t_9, &__pyx_t_5, &__pyx_t_11, NULL, __pyx_t_7);
        if (unlikely(__pyx_t_12 == 0)) break;
        if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(2, 101, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_XDECREF_SET(__pyx_9genexpr14__pyx_v_k, __pyx_t_5);
        __pyx_t_5 = 0;
        __Pyx_XDECREF_SET(__pyx_9genexpr14__pyx_v_v, __pyx_t_11);
        __pyx_t_11 = 0;

        /* "pyarrow/io-hdfs.pxi":100
 * 
 *         if extra_conf is not None and isinstance(extra_conf, dict):
 *             conf.extra_conf = {tobytes(k): tobytes(v)             # <<<<<<<<<<<<<<
 *                                for k, v in extra_conf.items()}
 *         self.extra_conf = extra_conf
 */
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 100, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_13 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
          }
        }
        __pyx_t_11 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_13, __pyx_9genexpr14__pyx_v_k) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_9genexpr14__pyx_v_k);
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 100, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 100, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_14 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
          __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
          if (likely(__pyx_t_14)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_13, function);
          }
        }
        __pyx_t_5 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, __pyx_9genexpr14__pyx_v_v) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_9genexpr14__pyx_v_v);
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 100, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(PyDict_SetItem(__pyx_t_4, (PyObject*)__pyx_t_11, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 100, __pyx_L18_error)
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_k); __pyx_9genexpr14__pyx_v_k = 0;
      __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_v); __pyx_9genexpr14__pyx_v_v = 0;
      goto __pyx_L21_exit_scope;
      __pyx_L18_error:;
      __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_k); __pyx_9genexpr14__pyx_v_k = 0;
      __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_v); __pyx_9genexpr14__pyx_v_v = 0;
      goto __pyx_L1_error;
      __pyx_L21_exit_scope:;
    } /* exit inner scope */
    __pyx_t_15 = __pyx_convert_unordered_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 100, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_conf.extra_conf = __pyx_t_15;

    /* "pyarrow/io-hdfs.pxi":99
 *         self.driver = driver
 * 
 *         if extra_conf is not None and isinstance(extra_conf, dict):             # <<<<<<<<<<<<<<
 *             conf.extra_conf = {tobytes(k): tobytes(v)
 *                                for k, v in extra_conf.items()}
 */
  }

  /* "pyarrow/io-hdfs.pxi":102
 *             conf.extra_conf = {tobytes(k): tobytes(v)
 *                                for k, v in extra_conf.items()}
 *         self.extra_conf = extra_conf             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  if (!(likely(PyDict_CheckExact(__pyx_v_extra_conf))||((__pyx_v_extra_conf) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_extra_conf)->tp_name), 0))) __PYX_ERR(2, 102, __pyx_L1_error)
  __pyx_t_4 = __pyx_v_extra_conf;
  __Pyx_INCREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->extra_conf);
  __Pyx_DECREF(__pyx_v_self->extra_conf);
  __pyx_v_self->extra_conf = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/io-hdfs.pxi":104
 *         self.extra_conf = extra_conf
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(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(2, 105, __pyx_L23_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_L24;
        }
        __pyx_L23_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L24:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":106
 *         with nogil:
 *             check_status(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_11);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem._connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_k);
  __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_v);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":109
 * 
 *     @classmethod
 *     def connect(cls, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         return cls(*args, **kwargs)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_3connect(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_2connect[] = "HadoopFileSystem.connect(type cls, *args, **kwargs)";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_3connect(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("connect (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "connect", 1))) return NULL;
  if (unlikely(__pyx_kwds)) {
    __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwargs);
  } else {
    __pyx_v_kwargs = NULL;
  }
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_2connect(((PyTypeObject*)__pyx_v_cls), __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_2connect(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("connect", 0);

  /* "pyarrow/io-hdfs.pxi":110
 *     @classmethod
 *     def connect(cls, *args, **kwargs):
 *         return cls(*args, **kwargs)             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io-hdfs.pxi":109
 * 
 *     @classmethod
 *     def connect(cls, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         return cls(*args, **kwargs)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":112
 *         return cls(*args, **kwargs)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.is_open:
 *             self.close()
 */

/* Python wrapper */
static void __pyx_pw_7pyarrow_3lib_16HadoopFileSystem_5__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7pyarrow_3lib_16HadoopFileSystem_5__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_4__dealloc__(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_4__dealloc__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pyarrow/io-hdfs.pxi":113
 * 
 *     def __dealloc__(self):
 *         if self.is_open:             # <<<<<<<<<<<<<<
 *             self.close()
 * 
 */
  __pyx_t_1 = (__pyx_v_self->is_open != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io-hdfs.pxi":114
 *     def __dealloc__(self):
 *         if self.is_open:
 *             self.close()             # <<<<<<<<<<<<<<
 * 
 *     def close(self):
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pyarrow/io-hdfs.pxi":113
 * 
 *     def __dealloc__(self):
 *         if self.is_open:             # <<<<<<<<<<<<<<
 *             self.close()
 * 
 */
  }

  /* "pyarrow/io-hdfs.pxi":112
 *         return cls(*args, **kwargs)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.is_open:
 *             self.close()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("pyarrow.lib.HadoopFileSystem.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/io-hdfs.pxi":116
 *             self.close()
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         """
 *         Disconnect from the HDFS cluster
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_7close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_6close[] = "HadoopFileSystem.close(self)\n\n        Disconnect from the HDFS cluster\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_7close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_6close(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_6close(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("close", 0);

  /* "pyarrow/io-hdfs.pxi":120
 *         Disconnect from the HDFS cluster
 *         """
 *         self._ensure_client()             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.client.get().Disconnect())
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self->__pyx_vtab)->_ensure_client(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":121
 *         """
 *         self._ensure_client()
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get().Disconnect())
 *         self.is_open = False
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":122
 *         self._ensure_client()
 *         with nogil:
 *             check_status(self.client.get().Disconnect())             # <<<<<<<<<<<<<<
 *         self.is_open = False
 * 
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->Disconnect()); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(2, 122, __pyx_L4_error)
      }

      /* "pyarrow/io-hdfs.pxi":121
 *         """
 *         self._ensure_client()
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get().Disconnect())
 *         self.is_open = False
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":123
 *         with nogil:
 *             check_status(self.client.get().Disconnect())
 *         self.is_open = False             # <<<<<<<<<<<<<<
 * 
 *     cdef _ensure_client(self):
 */
  __pyx_v_self->is_open = 0;

  /* "pyarrow/io-hdfs.pxi":116
 *             self.close()
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         """
 *         Disconnect from the HDFS cluster
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":125
 *         self.is_open = False
 * 
 *     cdef _ensure_client(self):             # <<<<<<<<<<<<<<
 *         if self.client.get() == NULL:
 *             raise IOError('HDFS client improperly initialized')
 */

static PyObject *__pyx_f_7pyarrow_3lib_16HadoopFileSystem__ensure_client(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("_ensure_client", 0);

  /* "pyarrow/io-hdfs.pxi":126
 * 
 *     cdef _ensure_client(self):
 *         if self.client.get() == NULL:             # <<<<<<<<<<<<<<
 *             raise IOError('HDFS client improperly initialized')
 *         elif not self.is_open:
 */
  __pyx_t_1 = ((__pyx_v_self->client.get() == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/io-hdfs.pxi":127
 *     cdef _ensure_client(self):
 *         if self.client.get() == NULL:
 *             raise IOError('HDFS client improperly initialized')             # <<<<<<<<<<<<<<
 *         elif not self.is_open:
 *             raise IOError('HDFS client is closed')
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__187, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 127, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(2, 127, __pyx_L1_error)

    /* "pyarrow/io-hdfs.pxi":126
 * 
 *     cdef _ensure_client(self):
 *         if self.client.get() == NULL:             # <<<<<<<<<<<<<<
 *             raise IOError('HDFS client improperly initialized')
 *         elif not self.is_open:
 */
  }

  /* "pyarrow/io-hdfs.pxi":128
 *         if self.client.get() == NULL:
 *             raise IOError('HDFS client improperly initialized')
 *         elif not self.is_open:             # <<<<<<<<<<<<<<
 *             raise IOError('HDFS client is closed')
 * 
 */
  __pyx_t_1 = ((!(__pyx_v_self->is_open != 0)) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/io-hdfs.pxi":129
 *             raise IOError('HDFS client improperly initialized')
 *         elif not self.is_open:
 *             raise IOError('HDFS client is closed')             # <<<<<<<<<<<<<<
 * 
 *     def exists(self, path):
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__188, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 129, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(2, 129, __pyx_L1_error)

    /* "pyarrow/io-hdfs.pxi":128
 *         if self.client.get() == NULL:
 *             raise IOError('HDFS client improperly initialized')
 *         elif not self.is_open:             # <<<<<<<<<<<<<<
 *             raise IOError('HDFS client is closed')
 * 
 */
  }

  /* "pyarrow/io-hdfs.pxi":125
 *         self.is_open = False
 * 
 *     cdef _ensure_client(self):             # <<<<<<<<<<<<<<
 *         if self.client.get() == NULL:
 *             raise IOError('HDFS client improperly initialized')
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem._ensure_client", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":131
 *             raise IOError('HDFS client is closed')
 * 
 *     def exists(self, path):             # <<<<<<<<<<<<<<
 *         """
 *         Returns True if the path is known to the cluster, False if it does not
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_9exists(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_8exists[] = "HadoopFileSystem.exists(self, path)\n\n        Returns True if the path is known to the cluster, False if it does not\n        (or there is an RPC error)\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_9exists(PyObject *__pyx_v_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("exists (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_8exists(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), ((PyObject *)__pyx_v_path));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_8exists(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path) {
  std::string __pyx_v_c_path;
  bool __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  __Pyx_RefNannySetupContext("exists", 0);

  /* "pyarrow/io-hdfs.pxi":136
 *         (or there is an RPC error)
 *         """
 *         self._ensure_client()             # <<<<<<<<<<<<<<
 * 
 *         cdef c_string c_path = tobytes(path)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self->__pyx_vtab)->_ensure_client(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":138
 *         self._ensure_client()
 * 
 *         cdef c_string c_path = tobytes(path)             # <<<<<<<<<<<<<<
 *         cdef c_bool result
 *         with nogil:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 138, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io-hdfs.pxi":140
 *         cdef c_string c_path = tobytes(path)
 *         cdef c_bool result
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = self.client.get().Exists(c_path)
 *         return result
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":141
 *         cdef c_bool result
 *         with nogil:
 *             result = self.client.get().Exists(c_path)             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
        __pyx_v_result = __pyx_v_self->client.get()->Exists(__pyx_v_c_path);
      }

      /* "pyarrow/io-hdfs.pxi":140
 *         cdef c_string c_path = tobytes(path)
 *         cdef c_bool result
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = self.client.get().Exists(c_path)
 *         return result
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":142
 *         with nogil:
 *             result = self.client.get().Exists(c_path)
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def isdir(self, path):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io-hdfs.pxi":131
 *             raise IOError('HDFS client is closed')
 * 
 *     def exists(self, path):             # <<<<<<<<<<<<<<
 *         """
 *         Returns True if the path is known to the cluster, False if it does not
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.exists", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":144
 *         return result
 * 
 *     def isdir(self, path):             # <<<<<<<<<<<<<<
 *         cdef HdfsPathInfo info
 *         try:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_11isdir(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_10isdir[] = "HadoopFileSystem.isdir(self, path)";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_11isdir(PyObject *__pyx_v_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isdir (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_10isdir(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), ((PyObject *)__pyx_v_path));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_10isdir(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path) {
  arrow::io::HdfsPathInfo __pyx_v_info;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("isdir", 0);

  /* "pyarrow/io-hdfs.pxi":146
 *     def isdir(self, path):
 *         cdef HdfsPathInfo info
 *         try:             # <<<<<<<<<<<<<<
 *             self._path_info(path, &info)
 *         except ArrowIOError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "pyarrow/io-hdfs.pxi":147
 *         cdef HdfsPathInfo info
 *         try:
 *             self._path_info(path, &info)             # <<<<<<<<<<<<<<
 *         except ArrowIOError:
 *             return False
 */
      __pyx_t_4 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self->__pyx_vtab)->_path_info(__pyx_v_self, __pyx_v_path, (&__pyx_v_info)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 147, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "pyarrow/io-hdfs.pxi":146
 *     def isdir(self, path):
 *         cdef HdfsPathInfo info
 *         try:             # <<<<<<<<<<<<<<
 *             self._path_info(path, &info)
 *         except ArrowIOError:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/io-hdfs.pxi":148
 *         try:
 *             self._path_info(path, &info)
 *         except ArrowIOError:             # <<<<<<<<<<<<<<
 *             return False
 *         return info.kind == ObjectType_DIRECTORY
 */
    __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ArrowIOError); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 148, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_4, __pyx_t_7);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_ErrRestore(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0;
    if (__pyx_t_8) {
      __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.isdir", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) __PYX_ERR(2, 148, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_4);

      /* "pyarrow/io-hdfs.pxi":149
 *             self._path_info(path, &info)
 *         except ArrowIOError:
 *             return False             # <<<<<<<<<<<<<<
 *         return info.kind == ObjectType_DIRECTORY
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/io-hdfs.pxi":146
 *     def isdir(self, path):
 *         cdef HdfsPathInfo info
 *         try:             # <<<<<<<<<<<<<<
 *             self._path_info(path, &info)
 *         except ArrowIOError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L8_try_end:;
  }

  /* "pyarrow/io-hdfs.pxi":150
 *         except ArrowIOError:
 *             return False
 *         return info.kind == ObjectType_DIRECTORY             # <<<<<<<<<<<<<<
 * 
 *     def isfile(self, path):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyBool_FromLong((__pyx_v_info.kind ==  arrow::io::ObjectType::DIRECTORY)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/io-hdfs.pxi":144
 *         return result
 * 
 *     def isdir(self, path):             # <<<<<<<<<<<<<<
 *         cdef HdfsPathInfo info
 *         try:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.isdir", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":152
 *         return info.kind == ObjectType_DIRECTORY
 * 
 *     def isfile(self, path):             # <<<<<<<<<<<<<<
 *         cdef HdfsPathInfo info
 *         try:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_13isfile(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_12isfile[] = "HadoopFileSystem.isfile(self, path)";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_13isfile(PyObject *__pyx_v_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isfile (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_12isfile(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), ((PyObject *)__pyx_v_path));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_12isfile(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path) {
  arrow::io::HdfsPathInfo __pyx_v_info;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("isfile", 0);

  /* "pyarrow/io-hdfs.pxi":154
 *     def isfile(self, path):
 *         cdef HdfsPathInfo info
 *         try:             # <<<<<<<<<<<<<<
 *             self._path_info(path, &info)
 *         except ArrowIOError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "pyarrow/io-hdfs.pxi":155
 *         cdef HdfsPathInfo info
 *         try:
 *             self._path_info(path, &info)             # <<<<<<<<<<<<<<
 *         except ArrowIOError:
 *             return False
 */
      __pyx_t_4 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self->__pyx_vtab)->_path_info(__pyx_v_self, __pyx_v_path, (&__pyx_v_info)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 155, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "pyarrow/io-hdfs.pxi":154
 *     def isfile(self, path):
 *         cdef HdfsPathInfo info
 *         try:             # <<<<<<<<<<<<<<
 *             self._path_info(path, &info)
 *         except ArrowIOError:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/io-hdfs.pxi":156
 *         try:
 *             self._path_info(path, &info)
 *         except ArrowIOError:             # <<<<<<<<<<<<<<
 *             return False
 *         return info.kind == ObjectType_FILE
 */
    __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ArrowIOError); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 156, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_4, __pyx_t_7);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_ErrRestore(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0;
    if (__pyx_t_8) {
      __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.isfile", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) __PYX_ERR(2, 156, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_4);

      /* "pyarrow/io-hdfs.pxi":157
 *             self._path_info(path, &info)
 *         except ArrowIOError:
 *             return False             # <<<<<<<<<<<<<<
 *         return info.kind == ObjectType_FILE
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/io-hdfs.pxi":154
 *     def isfile(self, path):
 *         cdef HdfsPathInfo info
 *         try:             # <<<<<<<<<<<<<<
 *             self._path_info(path, &info)
 *         except ArrowIOError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L8_try_end:;
  }

  /* "pyarrow/io-hdfs.pxi":158
 *         except ArrowIOError:
 *             return False
 *         return info.kind == ObjectType_FILE             # <<<<<<<<<<<<<<
 * 
 *     def get_capacity(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyBool_FromLong((__pyx_v_info.kind ==  arrow::io::ObjectType::FILE)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/io-hdfs.pxi":152
 *         return info.kind == ObjectType_DIRECTORY
 * 
 *     def isfile(self, path):             # <<<<<<<<<<<<<<
 *         cdef HdfsPathInfo info
 *         try:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.isfile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":160
 *         return info.kind == ObjectType_FILE
 * 
 *     def get_capacity(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get reported total capacity of file system
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_15get_capacity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_14get_capacity[] = "HadoopFileSystem.get_capacity(self)\n\n        Get reported total capacity of file system\n\n        Returns\n        -------\n        capacity : int\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_15get_capacity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_capacity (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_14get_capacity(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_14get_capacity(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  int64_t __pyx_v_capacity;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("get_capacity", 0);

  /* "pyarrow/io-hdfs.pxi":168
 *         capacity : int
 *         """
 *         cdef int64_t capacity = 0             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.client.get().GetCapacity(&capacity))
 */
  __pyx_v_capacity = 0;

  /* "pyarrow/io-hdfs.pxi":169
 *         """
 *         cdef int64_t capacity = 0
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get().GetCapacity(&capacity))
 *         return capacity
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":170
 *         cdef int64_t capacity = 0
 *         with nogil:
 *             check_status(self.client.get().GetCapacity(&capacity))             # <<<<<<<<<<<<<<
 *         return capacity
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->GetCapacity((&__pyx_v_capacity))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 170, __pyx_L4_error)
      }

      /* "pyarrow/io-hdfs.pxi":169
 *         """
 *         cdef int64_t capacity = 0
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get().GetCapacity(&capacity))
 *         return capacity
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":171
 *         with nogil:
 *             check_status(self.client.get().GetCapacity(&capacity))
 *         return capacity             # <<<<<<<<<<<<<<
 * 
 *     def get_space_used(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_capacity); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/io-hdfs.pxi":160
 *         return info.kind == ObjectType_FILE
 * 
 *     def get_capacity(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get reported total capacity of file system
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.get_capacity", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":173
 *         return capacity
 * 
 *     def get_space_used(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get space used on file system
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_17get_space_used(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_16get_space_used[] = "HadoopFileSystem.get_space_used(self)\n\n        Get space used on file system\n\n        Returns\n        -------\n        space_used : int\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_17get_space_used(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_space_used (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_16get_space_used(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_16get_space_used(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  int64_t __pyx_v_space_used;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("get_space_used", 0);

  /* "pyarrow/io-hdfs.pxi":181
 *         space_used : int
 *         """
 *         cdef int64_t space_used = 0             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.client.get().GetUsed(&space_used))
 */
  __pyx_v_space_used = 0;

  /* "pyarrow/io-hdfs.pxi":182
 *         """
 *         cdef int64_t space_used = 0
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get().GetUsed(&space_used))
 *         return space_used
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":183
 *         cdef int64_t space_used = 0
 *         with nogil:
 *             check_status(self.client.get().GetUsed(&space_used))             # <<<<<<<<<<<<<<
 *         return space_used
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->GetUsed((&__pyx_v_space_used))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 183, __pyx_L4_error)
      }

      /* "pyarrow/io-hdfs.pxi":182
 *         """
 *         cdef int64_t space_used = 0
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get().GetUsed(&space_used))
 *         return space_used
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":184
 *         with nogil:
 *             check_status(self.client.get().GetUsed(&space_used))
 *         return space_used             # <<<<<<<<<<<<<<
 * 
 *     def df(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_space_used); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/io-hdfs.pxi":173
 *         return capacity
 * 
 *     def get_space_used(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get space used on file system
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.get_space_used", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":186
 *         return space_used
 * 
 *     def df(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return free space on disk, like the UNIX df command
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_19df(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_18df[] = "HadoopFileSystem.df(self)\n\n        Return free space on disk, like the UNIX df command\n\n        Returns\n        -------\n        space : int\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_19df(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("df (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_18df(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_18df(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("df", 0);

  /* "pyarrow/io-hdfs.pxi":194
 *         space : int
 *         """
 *         return self.get_capacity() - self.get_space_used()             # <<<<<<<<<<<<<<
 * 
 *     def rename(self, path, new_path):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_capacity); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_space_used); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/io-hdfs.pxi":186
 *         return space_used
 * 
 *     def df(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return free space on disk, like the UNIX df command
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.df", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":196
 *         return self.get_capacity() - self.get_space_used()
 * 
 *     def rename(self, path, new_path):             # <<<<<<<<<<<<<<
 *         cdef c_string c_path = tobytes(path)
 *         cdef c_string c_new_path = tobytes(new_path)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_21rename(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_20rename[] = "HadoopFileSystem.rename(self, path, new_path)";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_21rename(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_new_path = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rename (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_new_path,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_new_path)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("rename", 1, 2, 2, 1); __PYX_ERR(2, 196, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rename") < 0)) __PYX_ERR(2, 196, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_path = values[0];
    __pyx_v_new_path = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("rename", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 196, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.rename", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_20rename(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), __pyx_v_path, __pyx_v_new_path);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_20rename(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_new_path) {
  std::string __pyx_v_c_path;
  std::string __pyx_v_c_new_path;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("rename", 0);

  /* "pyarrow/io-hdfs.pxi":197
 * 
 *     def rename(self, path, new_path):
 *         cdef c_string c_path = tobytes(path)             # <<<<<<<<<<<<<<
 *         cdef c_string c_new_path = tobytes(new_path)
 *         with nogil:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 197, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io-hdfs.pxi":198
 *     def rename(self, path, new_path):
 *         cdef c_string c_path = tobytes(path)
 *         cdef c_string c_new_path = tobytes(new_path)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.client.get().Rename(c_path, c_new_path))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_new_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_new_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 198, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_new_path = __pyx_t_4;

  /* "pyarrow/io-hdfs.pxi":199
 *         cdef c_string c_path = tobytes(path)
 *         cdef c_string c_new_path = tobytes(new_path)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get().Rename(c_path, c_new_path))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":200
 *         cdef c_string c_new_path = tobytes(new_path)
 *         with nogil:
 *             check_status(self.client.get().Rename(c_path, c_new_path))             # <<<<<<<<<<<<<<
 * 
 *     def info(self, path):
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->Rename(__pyx_v_c_path, __pyx_v_c_new_path)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 200, __pyx_L4_error)
      }

      /* "pyarrow/io-hdfs.pxi":199
 *         cdef c_string c_path = tobytes(path)
 *         cdef c_string c_new_path = tobytes(new_path)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get().Rename(c_path, c_new_path))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":196
 *         return self.get_capacity() - self.get_space_used()
 * 
 *     def rename(self, path, new_path):             # <<<<<<<<<<<<<<
 *         cdef c_string c_path = tobytes(path)
 *         cdef c_string c_new_path = tobytes(new_path)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.rename", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":202
 *             check_status(self.client.get().Rename(c_path, c_new_path))
 * 
 *     def info(self, path):             # <<<<<<<<<<<<<<
 *         """
 *         Return detailed HDFS information for path
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_23info(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_22info[] = "HadoopFileSystem.info(self, path)\n\n        Return detailed HDFS information for path\n\n        Parameters\n        ----------\n        path : string\n            Path to file or directory\n\n        Returns\n        -------\n        path_info : dict\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_23info(PyObject *__pyx_v_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("info (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_22info(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), ((PyObject *)__pyx_v_path));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_22info(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path) {
  arrow::io::HdfsPathInfo __pyx_v_info;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("info", 0);

  /* "pyarrow/io-hdfs.pxi":216
 *         """
 *         cdef HdfsPathInfo info
 *         self._path_info(path, &info)             # <<<<<<<<<<<<<<
 *         return {
 *             'path': frombytes(info.name),
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self->__pyx_vtab)->_path_info(__pyx_v_self, __pyx_v_path, (&__pyx_v_info)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":217
 *         cdef HdfsPathInfo info
 *         self._path_info(path, &info)
 *         return {             # <<<<<<<<<<<<<<
 *             'path': frombytes(info.name),
 *             'owner': frombytes(info.owner),
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/io-hdfs.pxi":218
 *         self._path_info(path, &info)
 *         return {
 *             'path': frombytes(info.name),             # <<<<<<<<<<<<<<
 *             'owner': frombytes(info.owner),
 *             'group': frombytes(info.group),
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(10); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_info.name); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_path, __pyx_t_2) < 0) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io-hdfs.pxi":219
 *         return {
 *             'path': frombytes(info.name),
 *             'owner': frombytes(info.owner),             # <<<<<<<<<<<<<<
 *             'group': frombytes(info.group),
 *             'size': info.size,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_info.owner); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_owner, __pyx_t_2) < 0) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io-hdfs.pxi":220
 *             'path': frombytes(info.name),
 *             'owner': frombytes(info.owner),
 *             'group': frombytes(info.group),             # <<<<<<<<<<<<<<
 *             'size': info.size,
 *             'block_size': info.block_size,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_info.group); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_group, __pyx_t_2) < 0) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io-hdfs.pxi":221
 *             'owner': frombytes(info.owner),
 *             'group': frombytes(info.group),
 *             'size': info.size,             # <<<<<<<<<<<<<<
 *             'block_size': info.block_size,
 *             'last_modified': info.last_modified_time,
 */
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_info.size); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_size, __pyx_t_2) < 0) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io-hdfs.pxi":222
 *             'group': frombytes(info.group),
 *             'size': info.size,
 *             'block_size': info.block_size,             # <<<<<<<<<<<<<<
 *             'last_modified': info.last_modified_time,
 *             'last_accessed': info.last_access_time,
 */
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_info.block_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_block_size, __pyx_t_2) < 0) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io-hdfs.pxi":223
 *             'size': info.size,
 *             'block_size': info.block_size,
 *             'last_modified': info.last_modified_time,             # <<<<<<<<<<<<<<
 *             'last_accessed': info.last_access_time,
 *             'replication': info.replication,
 */
  __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_info.last_modified_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_last_modified, __pyx_t_2) < 0) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io-hdfs.pxi":224
 *             'block_size': info.block_size,
 *             'last_modified': info.last_modified_time,
 *             'last_accessed': info.last_access_time,             # <<<<<<<<<<<<<<
 *             'replication': info.replication,
 *             'permissions': info.permissions,
 */
  __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_info.last_access_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_last_accessed, __pyx_t_2) < 0) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io-hdfs.pxi":225
 *             'last_modified': info.last_modified_time,
 *             'last_accessed': info.last_access_time,
 *             'replication': info.replication,             # <<<<<<<<<<<<<<
 *             'permissions': info.permissions,
 *             'kind': ('directory' if info.kind == ObjectType_DIRECTORY
 */
  __pyx_t_2 = __Pyx_PyInt_From_int16_t(__pyx_v_info.replication); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_replication, __pyx_t_2) < 0) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io-hdfs.pxi":226
 *             'last_accessed': info.last_access_time,
 *             'replication': info.replication,
 *             'permissions': info.permissions,             # <<<<<<<<<<<<<<
 *             'kind': ('directory' if info.kind == ObjectType_DIRECTORY
 *                      else 'file')
 */
  __pyx_t_2 = __Pyx_PyInt_From_int16_t(__pyx_v_info.permissions); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_permissions, __pyx_t_2) < 0) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io-hdfs.pxi":227
 *             'replication': info.replication,
 *             'permissions': info.permissions,
 *             'kind': ('directory' if info.kind == ObjectType_DIRECTORY             # <<<<<<<<<<<<<<
 *                      else 'file')
 *         }
 */
  if (((__pyx_v_info.kind ==  arrow::io::ObjectType::DIRECTORY) != 0)) {
    __Pyx_INCREF(__pyx_n_u_directory);
    __pyx_t_2 = __pyx_n_u_directory;
  } else {
    __Pyx_INCREF(__pyx_n_u_file);
    __pyx_t_2 = __pyx_n_u_file;
  }
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_kind, __pyx_t_2) < 0) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io-hdfs.pxi":202
 *             check_status(self.client.get().Rename(c_path, c_new_path))
 * 
 *     def info(self, path):             # <<<<<<<<<<<<<<
 *         """
 *         Return detailed HDFS information for path
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":231
 *         }
 * 
 *     def stat(self, path):             # <<<<<<<<<<<<<<
 *         """
 *         Return basic file system statistics about path
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_25stat(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_24stat[] = "HadoopFileSystem.stat(self, path)\n\n        Return basic file system statistics about path\n\n        Parameters\n        ----------\n        path : string\n            Path to file or directory\n\n        Returns\n        -------\n        stat : dict\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_25stat(PyObject *__pyx_v_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stat (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_24stat(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), ((PyObject *)__pyx_v_path));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_24stat(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path) {
  arrow::io::FileStatistics __pyx_v_info;
  std::string __pyx_v_c_path;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("stat", 0);

  /* "pyarrow/io-hdfs.pxi":245
 *         """
 *         cdef FileStatistics info
 *         cdef c_string c_path = tobytes(path)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.client.get()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 245, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io-hdfs.pxi":246
 *         cdef FileStatistics info
 *         cdef c_string c_path = tobytes(path)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .Stat(c_path, &info))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":247
 *         cdef c_string c_path = tobytes(path)
 *         with nogil:
 *             check_status(self.client.get()             # <<<<<<<<<<<<<<
 *                          .Stat(c_path, &info))
 *         return {
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->Stat(__pyx_v_c_path, (&__pyx_v_info))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 247, __pyx_L4_error)
      }

      /* "pyarrow/io-hdfs.pxi":246
 *         cdef FileStatistics info
 *         cdef c_string c_path = tobytes(path)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .Stat(c_path, &info))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":249
 *             check_status(self.client.get()
 *                          .Stat(c_path, &info))
 *         return {             # <<<<<<<<<<<<<<
 *             'size': info.size,
 *             'kind': ('directory' if info.kind == ObjectType_DIRECTORY
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/io-hdfs.pxi":250
 *                          .Stat(c_path, &info))
 *         return {
 *             'size': info.size,             # <<<<<<<<<<<<<<
 *             'kind': ('directory' if info.kind == ObjectType_DIRECTORY
 *                      else 'file')
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_info.size); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_size, __pyx_t_2) < 0) __PYX_ERR(2, 250, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io-hdfs.pxi":251
 *         return {
 *             'size': info.size,
 *             'kind': ('directory' if info.kind == ObjectType_DIRECTORY             # <<<<<<<<<<<<<<
 *                      else 'file')
 *         }
 */
  if (((__pyx_v_info.kind ==  arrow::io::ObjectType::DIRECTORY) != 0)) {
    __Pyx_INCREF(__pyx_n_u_directory);
    __pyx_t_2 = __pyx_n_u_directory;
  } else {
    __Pyx_INCREF(__pyx_n_u_file);
    __pyx_t_2 = __pyx_n_u_file;
  }
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_kind, __pyx_t_2) < 0) __PYX_ERR(2, 250, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io-hdfs.pxi":231
 *         }
 * 
 *     def stat(self, path):             # <<<<<<<<<<<<<<
 *         """
 *         Return basic file system statistics about path
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.stat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":255
 *         }
 * 
 *     cdef _path_info(self, path, HdfsPathInfo* info):             # <<<<<<<<<<<<<<
 *         cdef c_string c_path = tobytes(path)
 * 
 */

static PyObject *__pyx_f_7pyarrow_3lib_16HadoopFileSystem__path_info(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, arrow::io::HdfsPathInfo *__pyx_v_info) {
  std::string __pyx_v_c_path;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("_path_info", 0);

  /* "pyarrow/io-hdfs.pxi":256
 * 
 *     cdef _path_info(self, path, HdfsPathInfo* info):
 *         cdef c_string c_path = tobytes(path)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 256, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io-hdfs.pxi":258
 *         cdef c_string c_path = tobytes(path)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .GetPathInfo(c_path, info))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":259
 * 
 *         with nogil:
 *             check_status(self.client.get()             # <<<<<<<<<<<<<<
 *                          .GetPathInfo(c_path, info))
 * 
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->GetPathInfo(__pyx_v_c_path, __pyx_v_info)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 259, __pyx_L4_error)
      }

      /* "pyarrow/io-hdfs.pxi":258
 *         cdef c_string c_path = tobytes(path)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .GetPathInfo(c_path, info))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":255
 *         }
 * 
 *     cdef _path_info(self, path, HdfsPathInfo* info):             # <<<<<<<<<<<<<<
 *         cdef c_string c_path = tobytes(path)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem._path_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":262
 *                          .GetPathInfo(c_path, info))
 * 
 *     def ls(self, path, bint full_info):             # <<<<<<<<<<<<<<
 *         cdef:
 *             c_string c_path = tobytes(path)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_27ls(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_26ls[] = "HadoopFileSystem.ls(self, path, bool full_info)";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_27ls(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  int __pyx_v_full_info;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ls (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_full_info,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_full_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ls", 1, 2, 2, 1); __PYX_ERR(2, 262, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ls") < 0)) __PYX_ERR(2, 262, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_path = values[0];
    __pyx_v_full_info = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_full_info == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 262, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ls", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 262, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.ls", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_26ls(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), __pyx_v_path, __pyx_v_full_info);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_26ls(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, int __pyx_v_full_info) {
  std::string __pyx_v_c_path;
  std::vector<arrow::io::HdfsPathInfo>  __pyx_v_listing;
  PyObject *__pyx_v_results = 0;
  int __pyx_v_i;
  arrow::io::HdfsPathInfo const *__pyx_v_info;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_kind = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("ls", 0);

  /* "pyarrow/io-hdfs.pxi":264
 *     def ls(self, path, bint full_info):
 *         cdef:
 *             c_string c_path = tobytes(path)             # <<<<<<<<<<<<<<
 *             vector[HdfsPathInfo] listing
 *             list results = []
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 264, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io-hdfs.pxi":266
 *             c_string c_path = tobytes(path)
 *             vector[HdfsPathInfo] listing
 *             list results = []             # <<<<<<<<<<<<<<
 *             int i
 * 
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_results = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":269
 *             int i
 * 
 *         self._ensure_client()             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self->__pyx_vtab)->_ensure_client(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":271
 *         self._ensure_client()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .ListDirectory(c_path, &listing))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":272
 * 
 *         with nogil:
 *             check_status(self.client.get()             # <<<<<<<<<<<<<<
 *                          .ListDirectory(c_path, &listing))
 * 
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->ListDirectory(__pyx_v_c_path, (&__pyx_v_listing))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 272, __pyx_L4_error)
      }

      /* "pyarrow/io-hdfs.pxi":271
 *         self._ensure_client()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .ListDirectory(c_path, &listing))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":276
 * 
 *         cdef const HdfsPathInfo* info
 *         for i in range(<int> listing.size()):             # <<<<<<<<<<<<<<
 *             info = &listing[i]
 * 
 */
  __pyx_t_5 = ((int)__pyx_v_listing.size());
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "pyarrow/io-hdfs.pxi":277
 *         cdef const HdfsPathInfo* info
 *         for i in range(<int> listing.size()):
 *             info = &listing[i]             # <<<<<<<<<<<<<<
 * 
 *             # Try to trim off the hdfs://HOST:PORT piece
 */
    __pyx_v_info = (&(__pyx_v_listing[__pyx_v_i]));

    /* "pyarrow/io-hdfs.pxi":280
 * 
 *             # Try to trim off the hdfs://HOST:PORT piece
 *             name = strip_hdfs_abspath(frombytes(info.name))             # <<<<<<<<<<<<<<
 * 
 *             if full_info:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_strip_hdfs_abspath); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 280, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 280, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_info->name); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 280, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_3 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 280, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 280, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/io-hdfs.pxi":282
 *             name = strip_hdfs_abspath(frombytes(info.name))
 * 
 *             if full_info:             # <<<<<<<<<<<<<<
 *                 kind = ('file' if info.kind == ObjectType_FILE
 *                         else 'directory')
 */
    __pyx_t_11 = (__pyx_v_full_info != 0);
    if (__pyx_t_11) {

      /* "pyarrow/io-hdfs.pxi":283
 * 
 *             if full_info:
 *                 kind = ('file' if info.kind == ObjectType_FILE             # <<<<<<<<<<<<<<
 *                         else 'directory')
 * 
 */
      if (((__pyx_v_info->kind ==  arrow::io::ObjectType::FILE) != 0)) {
        __Pyx_INCREF(__pyx_n_u_file);
        __pyx_t_1 = __pyx_n_u_file;
      } else {
        __Pyx_INCREF(__pyx_n_u_directory);
        __pyx_t_1 = __pyx_n_u_directory;
      }
      __Pyx_XDECREF_SET(__pyx_v_kind, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "pyarrow/io-hdfs.pxi":287
 * 
 *                 results.append({
 *                     'kind': kind,             # <<<<<<<<<<<<<<
 *                     'name': name,
 *                     'owner': frombytes(info.owner),
 */
      __pyx_t_1 = __Pyx_PyDict_NewPresized(10); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_kind, __pyx_v_kind) < 0) __PYX_ERR(2, 287, __pyx_L1_error)

      /* "pyarrow/io-hdfs.pxi":288
 *                 results.append({
 *                     'kind': kind,
 *                     'name': name,             # <<<<<<<<<<<<<<
 *                     'owner': frombytes(info.owner),
 *                     'group': frombytes(info.group),
 */
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_name_2, __pyx_v_name) < 0) __PYX_ERR(2, 287, __pyx_L1_error)

      /* "pyarrow/io-hdfs.pxi":289
 *                     'kind': kind,
 *                     'name': name,
 *                     'owner': frombytes(info.owner),             # <<<<<<<<<<<<<<
 *                     'group': frombytes(info.group),
 *                     'last_modified_time': info.last_modified_time,
 */
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_info->owner); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_owner, __pyx_t_2) < 0) __PYX_ERR(2, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyarrow/io-hdfs.pxi":290
 *                     'name': name,
 *                     'owner': frombytes(info.owner),
 *                     'group': frombytes(info.group),             # <<<<<<<<<<<<<<
 *                     'last_modified_time': info.last_modified_time,
 *                     'last_access_time': info.last_access_time,
 */
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 290, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_info->group); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 290, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 290, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_group, __pyx_t_2) < 0) __PYX_ERR(2, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyarrow/io-hdfs.pxi":291
 *                     'owner': frombytes(info.owner),
 *                     'group': frombytes(info.group),
 *                     'last_modified_time': info.last_modified_time,             # <<<<<<<<<<<<<<
 *                     'last_access_time': info.last_access_time,
 *                     'size': info.size,
 */
      __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_info->last_modified_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 291, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_last_modified_time, __pyx_t_2) < 0) __PYX_ERR(2, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyarrow/io-hdfs.pxi":292
 *                     'group': frombytes(info.group),
 *                     'last_modified_time': info.last_modified_time,
 *                     'last_access_time': info.last_access_time,             # <<<<<<<<<<<<<<
 *                     'size': info.size,
 *                     'replication': info.replication,
 */
      __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_info->last_access_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 292, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_last_access_time, __pyx_t_2) < 0) __PYX_ERR(2, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyarrow/io-hdfs.pxi":293
 *                     'last_modified_time': info.last_modified_time,
 *                     'last_access_time': info.last_access_time,
 *                     'size': info.size,             # <<<<<<<<<<<<<<
 *                     'replication': info.replication,
 *                     'block_size': info.block_size,
 */
      __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_info->size); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 293, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_size, __pyx_t_2) < 0) __PYX_ERR(2, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyarrow/io-hdfs.pxi":294
 *                     'last_access_time': info.last_access_time,
 *                     'size': info.size,
 *                     'replication': info.replication,             # <<<<<<<<<<<<<<
 *                     'block_size': info.block_size,
 *                     'permissions': info.permissions
 */
      __pyx_t_2 = __Pyx_PyInt_From_int16_t(__pyx_v_info->replication); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 294, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_replication, __pyx_t_2) < 0) __PYX_ERR(2, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyarrow/io-hdfs.pxi":295
 *                     'size': info.size,
 *                     'replication': info.replication,
 *                     'block_size': info.block_size,             # <<<<<<<<<<<<<<
 *                     'permissions': info.permissions
 *                 })
 */
      __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_info->block_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 295, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_block_size, __pyx_t_2) < 0) __PYX_ERR(2, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyarrow/io-hdfs.pxi":296
 *                     'replication': info.replication,
 *                     'block_size': info.block_size,
 *                     'permissions': info.permissions             # <<<<<<<<<<<<<<
 *                 })
 *             else:
 */
      __pyx_t_2 = __Pyx_PyInt_From_int16_t(__pyx_v_info->permissions); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 296, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_permissions, __pyx_t_2) < 0) __PYX_ERR(2, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyarrow/io-hdfs.pxi":286
 *                         else 'directory')
 * 
 *                 results.append({             # <<<<<<<<<<<<<<
 *                     'kind': kind,
 *                     'name': name,
 */
      __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_results, __pyx_t_1); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(2, 286, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "pyarrow/io-hdfs.pxi":282
 *             name = strip_hdfs_abspath(frombytes(info.name))
 * 
 *             if full_info:             # <<<<<<<<<<<<<<
 *                 kind = ('file' if info.kind == ObjectType_FILE
 *                         else 'directory')
 */
      goto __pyx_L8;
    }

    /* "pyarrow/io-hdfs.pxi":299
 *                 })
 *             else:
 *                 results.append(name)             # <<<<<<<<<<<<<<
 * 
 *         return results
 */
    /*else*/ {
      __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_results, __pyx_v_name); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(2, 299, __pyx_L1_error)
    }
    __pyx_L8:;
  }

  /* "pyarrow/io-hdfs.pxi":301
 *                 results.append(name)
 * 
 *         return results             # <<<<<<<<<<<<<<
 * 
 *     def chmod(self, path, mode):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_results);
  __pyx_r = __pyx_v_results;
  goto __pyx_L0;

  /* "pyarrow/io-hdfs.pxi":262
 *                          .GetPathInfo(c_path, info))
 * 
 *     def ls(self, path, bint full_info):             # <<<<<<<<<<<<<<
 *         cdef:
 *             c_string c_path = tobytes(path)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.ls", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_results);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_kind);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":303
 *         return results
 * 
 *     def chmod(self, path, mode):             # <<<<<<<<<<<<<<
 *         """
 *         Change file permissions
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_29chmod(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_28chmod[] = "HadoopFileSystem.chmod(self, path, mode)\n\n        Change file permissions\n\n        Parameters\n        ----------\n        path : string\n            absolute path to file or directory\n        mode : int\n            POSIX-like bitmask\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_29chmod(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_mode = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("chmod (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_mode,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("chmod", 1, 2, 2, 1); __PYX_ERR(2, 303, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "chmod") < 0)) __PYX_ERR(2, 303, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_path = values[0];
    __pyx_v_mode = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("chmod", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 303, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.chmod", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_28chmod(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), __pyx_v_path, __pyx_v_mode);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_28chmod(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_mode) {
  std::string __pyx_v_c_path;
  int __pyx_v_c_mode;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("chmod", 0);

  /* "pyarrow/io-hdfs.pxi":314
 *             POSIX-like bitmask
 *         """
 *         self._ensure_client()             # <<<<<<<<<<<<<<
 *         cdef c_string c_path = tobytes(path)
 *         cdef int c_mode = mode
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self->__pyx_vtab)->_ensure_client(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":315
 *         """
 *         self._ensure_client()
 *         cdef c_string c_path = tobytes(path)             # <<<<<<<<<<<<<<
 *         cdef int c_mode = mode
 *         with nogil:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 315, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io-hdfs.pxi":316
 *         self._ensure_client()
 *         cdef c_string c_path = tobytes(path)
 *         cdef int c_mode = mode             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.client.get()
 */
  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_mode); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 316, __pyx_L1_error)
  __pyx_v_c_mode = __pyx_t_5;

  /* "pyarrow/io-hdfs.pxi":317
 *         cdef c_string c_path = tobytes(path)
 *         cdef int c_mode = mode
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .Chmod(c_path, c_mode))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":318
 *         cdef int c_mode = mode
 *         with nogil:
 *             check_status(self.client.get()             # <<<<<<<<<<<<<<
 *                          .Chmod(c_path, c_mode))
 * 
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->Chmod(__pyx_v_c_path, __pyx_v_c_mode)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 318, __pyx_L4_error)
      }

      /* "pyarrow/io-hdfs.pxi":317
 *         cdef c_string c_path = tobytes(path)
 *         cdef int c_mode = mode
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .Chmod(c_path, c_mode))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":303
 *         return results
 * 
 *     def chmod(self, path, mode):             # <<<<<<<<<<<<<<
 *         """
 *         Change file permissions
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.chmod", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":321
 *                          .Chmod(c_path, c_mode))
 * 
 *     def chown(self, path, owner=None, group=None):             # <<<<<<<<<<<<<<
 *         """
 *         Change file permissions
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_31chown(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_30chown[] = "HadoopFileSystem.chown(self, path, owner=None, group=None)\n\n        Change file permissions\n\n        Parameters\n        ----------\n        path : string\n            absolute path to file or directory\n        owner : string, default None\n            New owner, None for no change\n        group : string, default None\n            New group, None for no change\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_31chown(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_owner = 0;
  PyObject *__pyx_v_group = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("chown (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_owner,&__pyx_n_s_group,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_owner);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_group);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "chown") < 0)) __PYX_ERR(2, 321, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_path = values[0];
    __pyx_v_owner = values[1];
    __pyx_v_group = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("chown", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 321, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.chown", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_30chown(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), __pyx_v_path, __pyx_v_owner, __pyx_v_group);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_30chown(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_owner, PyObject *__pyx_v_group) {
  std::string __pyx_v_c_path;
  std::string __pyx_v_c_owner;
  std::string __pyx_v_c_group;
  char const *__pyx_v_c_owner_ptr;
  char const *__pyx_v_c_group_ptr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("chown", 0);

  /* "pyarrow/io-hdfs.pxi":338
 *             c_string c_owner
 *             c_string c_group
 *             const char* c_owner_ptr = NULL             # <<<<<<<<<<<<<<
 *             const char* c_group_ptr = NULL
 * 
 */
  __pyx_v_c_owner_ptr = NULL;

  /* "pyarrow/io-hdfs.pxi":339
 *             c_string c_group
 *             const char* c_owner_ptr = NULL
 *             const char* c_group_ptr = NULL             # <<<<<<<<<<<<<<
 * 
 *         self._ensure_client()
 */
  __pyx_v_c_group_ptr = NULL;

  /* "pyarrow/io-hdfs.pxi":341
 *             const char* c_group_ptr = NULL
 * 
 *         self._ensure_client()             # <<<<<<<<<<<<<<
 * 
 *         c_path = tobytes(path)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self->__pyx_vtab)->_ensure_client(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":343
 *         self._ensure_client()
 * 
 *         c_path = tobytes(path)             # <<<<<<<<<<<<<<
 *         if owner is not None:
 *             c_owner = tobytes(owner)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 343, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io-hdfs.pxi":344
 * 
 *         c_path = tobytes(path)
 *         if owner is not None:             # <<<<<<<<<<<<<<
 *             c_owner = tobytes(owner)
 *             c_owner_ptr = c_owner.c_str()
 */
  __pyx_t_5 = (__pyx_v_owner != Py_None);
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {

    /* "pyarrow/io-hdfs.pxi":345
 *         c_path = tobytes(path)
 *         if owner is not None:
 *             c_owner = tobytes(owner)             # <<<<<<<<<<<<<<
 *             c_owner_ptr = c_owner.c_str()
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 345, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_owner) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_owner);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 345, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 345, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_owner = __pyx_t_4;

    /* "pyarrow/io-hdfs.pxi":346
 *         if owner is not None:
 *             c_owner = tobytes(owner)
 *             c_owner_ptr = c_owner.c_str()             # <<<<<<<<<<<<<<
 * 
 *         if group is not None:
 */
    __pyx_v_c_owner_ptr = __pyx_v_c_owner.c_str();

    /* "pyarrow/io-hdfs.pxi":344
 * 
 *         c_path = tobytes(path)
 *         if owner is not None:             # <<<<<<<<<<<<<<
 *             c_owner = tobytes(owner)
 *             c_owner_ptr = c_owner.c_str()
 */
  }

  /* "pyarrow/io-hdfs.pxi":348
 *             c_owner_ptr = c_owner.c_str()
 * 
 *         if group is not None:             # <<<<<<<<<<<<<<
 *             c_group = tobytes(group)
 *             c_group_ptr = c_group.c_str()
 */
  __pyx_t_6 = (__pyx_v_group != Py_None);
  __pyx_t_5 = (__pyx_t_6 != 0);
  if (__pyx_t_5) {

    /* "pyarrow/io-hdfs.pxi":349
 * 
 *         if group is not None:
 *             c_group = tobytes(group)             # <<<<<<<<<<<<<<
 *             c_group_ptr = c_group.c_str()
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 349, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_group) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_group);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 349, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 349, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_group = __pyx_t_4;

    /* "pyarrow/io-hdfs.pxi":350
 *         if group is not None:
 *             c_group = tobytes(group)
 *             c_group_ptr = c_group.c_str()             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
    __pyx_v_c_group_ptr = __pyx_v_c_group.c_str();

    /* "pyarrow/io-hdfs.pxi":348
 *             c_owner_ptr = c_owner.c_str()
 * 
 *         if group is not None:             # <<<<<<<<<<<<<<
 *             c_group = tobytes(group)
 *             c_group_ptr = c_group.c_str()
 */
  }

  /* "pyarrow/io-hdfs.pxi":352
 *             c_group_ptr = c_group.c_str()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .Chown(c_path, c_owner_ptr, c_group_ptr))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":353
 * 
 *         with nogil:
 *             check_status(self.client.get()             # <<<<<<<<<<<<<<
 *                          .Chown(c_path, c_owner_ptr, c_group_ptr))
 * 
 */
        __pyx_t_7 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->Chown(__pyx_v_c_path, __pyx_v_c_owner_ptr, __pyx_v_c_group_ptr)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 353, __pyx_L6_error)
      }

      /* "pyarrow/io-hdfs.pxi":352
 *             c_group_ptr = c_group.c_str()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .Chown(c_path, c_owner_ptr, c_group_ptr))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L6_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":321
 *                          .Chmod(c_path, c_mode))
 * 
 *     def chown(self, path, owner=None, group=None):             # <<<<<<<<<<<<<<
 *         """
 *         Change file permissions
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.chown", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":356
 *                          .Chown(c_path, c_owner_ptr, c_group_ptr))
 * 
 *     def mkdir(self, path):             # <<<<<<<<<<<<<<
 *         """
 *         Create indicated directory and any necessary parent directories
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_33mkdir(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_32mkdir[] = "HadoopFileSystem.mkdir(self, path)\n\n        Create indicated directory and any necessary parent directories\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_33mkdir(PyObject *__pyx_v_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mkdir (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_32mkdir(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), ((PyObject *)__pyx_v_path));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_32mkdir(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path) {
  std::string __pyx_v_c_path;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("mkdir", 0);

  /* "pyarrow/io-hdfs.pxi":360
 *         Create indicated directory and any necessary parent directories
 *         """
 *         self._ensure_client()             # <<<<<<<<<<<<<<
 *         cdef c_string c_path = tobytes(path)
 *         with nogil:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self->__pyx_vtab)->_ensure_client(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":361
 *         """
 *         self._ensure_client()
 *         cdef c_string c_path = tobytes(path)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.client.get()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 361, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io-hdfs.pxi":362
 *         self._ensure_client()
 *         cdef c_string c_path = tobytes(path)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .MakeDirectory(c_path))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":363
 *         cdef c_string c_path = tobytes(path)
 *         with nogil:
 *             check_status(self.client.get()             # <<<<<<<<<<<<<<
 *                          .MakeDirectory(c_path))
 * 
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->MakeDirectory(__pyx_v_c_path)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 363, __pyx_L4_error)
      }

      /* "pyarrow/io-hdfs.pxi":362
 *         self._ensure_client()
 *         cdef c_string c_path = tobytes(path)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .MakeDirectory(c_path))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":356
 *                          .Chown(c_path, c_owner_ptr, c_group_ptr))
 * 
 *     def mkdir(self, path):             # <<<<<<<<<<<<<<
 *         """
 *         Create indicated directory and any necessary parent directories
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.mkdir", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":366
 *                          .MakeDirectory(c_path))
 * 
 *     def delete(self, path, bint recursive=False):             # <<<<<<<<<<<<<<
 *         """
 *         Delete the indicated file or directory
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_35delete(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_34delete[] = "HadoopFileSystem.delete(self, path, bool recursive=False)\n\n        Delete the indicated file or directory\n\n        Parameters\n        ----------\n        path : string\n        recursive : boolean, default False\n            If True, also delete child paths for directories\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_35delete(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  int __pyx_v_recursive;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delete (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_recursive,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_recursive);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delete") < 0)) __PYX_ERR(2, 366, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_path = values[0];
    if (values[1]) {
      __pyx_v_recursive = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_recursive == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 366, __pyx_L3_error)
    } else {
      __pyx_v_recursive = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("delete", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 366, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.delete", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_34delete(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), __pyx_v_path, __pyx_v_recursive);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_34delete(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, int __pyx_v_recursive) {
  std::string __pyx_v_c_path;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("delete", 0);

  /* "pyarrow/io-hdfs.pxi":376
 *             If True, also delete child paths for directories
 *         """
 *         self._ensure_client()             # <<<<<<<<<<<<<<
 * 
 *         cdef c_string c_path = tobytes(path)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self->__pyx_vtab)->_ensure_client(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":378
 *         self._ensure_client()
 * 
 *         cdef c_string c_path = tobytes(path)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.client.get()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 378, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io-hdfs.pxi":379
 * 
 *         cdef c_string c_path = tobytes(path)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .Delete(c_path, recursive == 1))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":380
 *         cdef c_string c_path = tobytes(path)
 *         with nogil:
 *             check_status(self.client.get()             # <<<<<<<<<<<<<<
 *                          .Delete(c_path, recursive == 1))
 * 
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->Delete(__pyx_v_c_path, (__pyx_v_recursive == 1))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 380, __pyx_L4_error)
      }

      /* "pyarrow/io-hdfs.pxi":379
 * 
 *         cdef c_string c_path = tobytes(path)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .Delete(c_path, recursive == 1))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":366
 *                          .MakeDirectory(c_path))
 * 
 *     def delete(self, path, bint recursive=False):             # <<<<<<<<<<<<<<
 *         """
 *         Delete the indicated file or directory
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.delete", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":383
 *                          .Delete(c_path, recursive == 1))
 * 
 *     def open(self, path, mode='rb', buffer_size=None, replication=None,             # <<<<<<<<<<<<<<
 *              default_block_size=None):
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_37open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_36open[] = "HadoopFileSystem.open(self, path, mode=u'rb', buffer_size=None, replication=None, default_block_size=None)\n\n        Open HDFS file for reading or writing\n\n        Parameters\n        ----------\n        mode : string\n            Must be one of 'rb', 'wb', 'ab'\n\n        Returns\n        -------\n        handle : HdfsFile\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_37open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_mode = 0;
  PyObject *__pyx_v_buffer_size = 0;
  PyObject *__pyx_v_replication = 0;
  PyObject *__pyx_v_default_block_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("open (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_mode,&__pyx_n_s_buffer_size,&__pyx_n_s_replication,&__pyx_n_s_default_block_size,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_n_u_rb_2);
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);

    /* "pyarrow/io-hdfs.pxi":384
 * 
 *     def open(self, path, mode='rb', buffer_size=None, replication=None,
 *              default_block_size=None):             # <<<<<<<<<<<<<<
 *         """
 *         Open HDFS file for reading or writing
 */
    values[4] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer_size);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_replication);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default_block_size);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "open") < 0)) __PYX_ERR(2, 383, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_path = values[0];
    __pyx_v_mode = values[1];
    __pyx_v_buffer_size = values[2];
    __pyx_v_replication = values[3];
    __pyx_v_default_block_size = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("open", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 383, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_36open(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), __pyx_v_path, __pyx_v_mode, __pyx_v_buffer_size, __pyx_v_replication, __pyx_v_default_block_size);

  /* "pyarrow/io-hdfs.pxi":383
 *                          .Delete(c_path, recursive == 1))
 * 
 *     def open(self, path, mode='rb', buffer_size=None, replication=None,             # <<<<<<<<<<<<<<
 *              default_block_size=None):
 *         """
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_36open(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_mode, PyObject *__pyx_v_buffer_size, PyObject *__pyx_v_replication, PyObject *__pyx_v_default_block_size) {
  struct __pyx_obj_7pyarrow_3lib_HdfsFile *__pyx_v_out = 0;
  std::string __pyx_v_c_path;
  bool __pyx_v_append;
  int32_t __pyx_v_c_buffer_size;
  int16_t __pyx_v_c_replication;
  int64_t __pyx_v_c_default_block_size;
  std::shared_ptr<arrow::io::HdfsOutputStream>  __pyx_v_wr_handle;
  std::shared_ptr<arrow::io::HdfsReadableFile>  __pyx_v_rd_handle;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  int32_t __pyx_t_7;
  int32_t __pyx_t_8;
  int16_t __pyx_t_9;
  int16_t __pyx_t_10;
  int64_t __pyx_t_11;
  int64_t __pyx_t_12;
  int __pyx_t_13;
  __Pyx_RefNannySetupContext("open", 0);

  /* "pyarrow/io-hdfs.pxi":397
 *         handle : HdfsFile
 *         """
 *         self._ensure_client()             # <<<<<<<<<<<<<<
 * 
 *         cdef HdfsFile out = HdfsFile()
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self->__pyx_vtab)->_ensure_client(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":399
 *         self._ensure_client()
 * 
 *         cdef HdfsFile out = HdfsFile()             # <<<<<<<<<<<<<<
 * 
 *         if mode not in ('rb', 'wb', 'ab'):
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_HdfsFile)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_HdfsFile *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":401
 *         cdef HdfsFile out = HdfsFile()
 * 
 *         if mode not in ('rb', 'wb', 'ab'):             # <<<<<<<<<<<<<<
 *             raise Exception("Mode must be 'rb' (read), "
 *                             "'wb' (write, new file), or 'ab' (append)")
 */
  __Pyx_INCREF(__pyx_v_mode);
  __pyx_t_1 = __pyx_v_mode;
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_rb_2, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(2, 401, __pyx_L1_error)
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_wb, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(2, 401, __pyx_L1_error)
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_ab, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(2, 401, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (unlikely(__pyx_t_3)) {

    /* "pyarrow/io-hdfs.pxi":402
 * 
 *         if mode not in ('rb', 'wb', 'ab'):
 *             raise Exception("Mode must be 'rb' (read), "             # <<<<<<<<<<<<<<
 *                             "'wb' (write, new file), or 'ab' (append)")
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__189, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(2, 402, __pyx_L1_error)

    /* "pyarrow/io-hdfs.pxi":401
 *         cdef HdfsFile out = HdfsFile()
 * 
 *         if mode not in ('rb', 'wb', 'ab'):             # <<<<<<<<<<<<<<
 *             raise Exception("Mode must be 'rb' (read), "
 *                             "'wb' (write, new file), or 'ab' (append)")
 */
  }

  /* "pyarrow/io-hdfs.pxi":405
 *                             "'wb' (write, new file), or 'ab' (append)")
 * 
 *         cdef c_string c_path = tobytes(path)             # <<<<<<<<<<<<<<
 *         cdef c_bool append = False
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 405, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_6;

  /* "pyarrow/io-hdfs.pxi":406
 * 
 *         cdef c_string c_path = tobytes(path)
 *         cdef c_bool append = False             # <<<<<<<<<<<<<<
 * 
 *         # 0 in libhdfs means "use the default"
 */
  __pyx_v_append = 0;

  /* "pyarrow/io-hdfs.pxi":409
 * 
 *         # 0 in libhdfs means "use the default"
 *         cdef int32_t c_buffer_size = buffer_size or 0             # <<<<<<<<<<<<<<
 *         cdef int16_t c_replication = replication or 0
 *         cdef int64_t c_default_block_size = default_block_size or 0
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_buffer_size); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(2, 409, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_8 = __Pyx_PyInt_As_int32_t(__pyx_v_buffer_size); if (unlikely((__pyx_t_8 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 409, __pyx_L1_error)
    __pyx_t_7 = __pyx_t_8;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_7 = 0;
  __pyx_L7_bool_binop_done:;
  __pyx_v_c_buffer_size = __pyx_t_7;

  /* "pyarrow/io-hdfs.pxi":410
 *         # 0 in libhdfs means "use the default"
 *         cdef int32_t c_buffer_size = buffer_size or 0
 *         cdef int16_t c_replication = replication or 0             # <<<<<<<<<<<<<<
 *         cdef int64_t c_default_block_size = default_block_size or 0
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_replication); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(2, 410, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_v_replication); if (unlikely((__pyx_t_10 == ((int16_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 410, __pyx_L1_error)
    __pyx_t_9 = __pyx_t_10;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_9 = 0;
  __pyx_L9_bool_binop_done:;
  __pyx_v_c_replication = __pyx_t_9;

  /* "pyarrow/io-hdfs.pxi":411
 *         cdef int32_t c_buffer_size = buffer_size or 0
 *         cdef int16_t c_replication = replication or 0
 *         cdef int64_t c_default_block_size = default_block_size or 0             # <<<<<<<<<<<<<<
 * 
 *         cdef shared_ptr[HdfsOutputStream] wr_handle
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_default_block_size); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(2, 411, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_12 = __Pyx_PyInt_As_int64_t(__pyx_v_default_block_size); if (unlikely((__pyx_t_12 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 411, __pyx_L1_error)
    __pyx_t_11 = __pyx_t_12;
    goto __pyx_L11_bool_binop_done;
  }
  __pyx_t_11 = 0;
  __pyx_L11_bool_binop_done:;
  __pyx_v_c_default_block_size = __pyx_t_11;

  /* "pyarrow/io-hdfs.pxi":416
 *         cdef shared_ptr[HdfsReadableFile] rd_handle
 * 
 *         if mode in ('wb', 'ab'):             # <<<<<<<<<<<<<<
 *             if mode == 'ab':
 *                 append = True
 */
  __Pyx_INCREF(__pyx_v_mode);
  __pyx_t_1 = __pyx_v_mode;
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_wb, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 416, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L14_bool_binop_done;
  }
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_ab, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 416, __pyx_L1_error)
  __pyx_t_3 = __pyx_t_2;
  __pyx_L14_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/io-hdfs.pxi":417
 * 
 *         if mode in ('wb', 'ab'):
 *             if mode == 'ab':             # <<<<<<<<<<<<<<
 *                 append = True
 * 
 */
    __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_mode, __pyx_n_u_ab, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 417, __pyx_L1_error)
    if (__pyx_t_2) {

      /* "pyarrow/io-hdfs.pxi":418
 *         if mode in ('wb', 'ab'):
 *             if mode == 'ab':
 *                 append = True             # <<<<<<<<<<<<<<
 * 
 *             with nogil:
 */
      __pyx_v_append = 1;

      /* "pyarrow/io-hdfs.pxi":417
 * 
 *         if mode in ('wb', 'ab'):
 *             if mode == 'ab':             # <<<<<<<<<<<<<<
 *                 append = True
 * 
 */
    }

    /* "pyarrow/io-hdfs.pxi":420
 *                 append = True
 * 
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(
 *                     self.client.get()
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/io-hdfs.pxi":421
 * 
 *             with nogil:
 *                 check_status(             # <<<<<<<<<<<<<<
 *                     self.client.get()
 *                     .OpenWritable(c_path, append, c_buffer_size,
 */
          __pyx_t_13 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->OpenWritable(__pyx_v_c_path, __pyx_v_append, __pyx_v_c_buffer_size, __pyx_v_c_replication, __pyx_v_c_default_block_size, (&__pyx_v_wr_handle))); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(2, 421, __pyx_L18_error)
        }

        /* "pyarrow/io-hdfs.pxi":420
 *                 append = True
 * 
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(
 *                     self.client.get()
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L19;
          }
          __pyx_L18_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L19:;
        }
    }

    /* "pyarrow/io-hdfs.pxi":427
 *                                   &wr_handle))
 * 
 *             out.set_output_stream(<shared_ptr[OutputStream]> wr_handle)             # <<<<<<<<<<<<<<
 *             out.is_writable = True
 *         else:
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HdfsFile *)__pyx_v_out->__pyx_base.__pyx_vtab)->__pyx_base.set_output_stream(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_out), ((std::shared_ptr<arrow::io::OutputStream> )__pyx_v_wr_handle)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 427, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/io-hdfs.pxi":428
 * 
 *             out.set_output_stream(<shared_ptr[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(2, 431, __pyx_L21_error)
        }

        /* "pyarrow/io-hdfs.pxi":430
 *             out.is_writable = True
 *         else:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(self.client.get()
 *                              .OpenReadable(c_path, &rd_handle))
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L22;
          }
          __pyx_L21_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L22:;
        }
    }

    /* "pyarrow/io-hdfs.pxi":434
 *                              .OpenReadable(c_path, &rd_handle))
 * 
 *             out.set_random_access_file(             # <<<<<<<<<<<<<<
 *                 <shared_ptr[RandomAccessFile]> rd_handle)
 *             out.is_readable = True
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HdfsFile *)__pyx_v_out->__pyx_base.__pyx_vtab)->__pyx_base.set_random_access_file(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_out), ((std::shared_ptr<arrow::io::RandomAccessFile> )__pyx_v_rd_handle)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 434, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/io-hdfs.pxi":436
 *             out.set_random_access_file(
 *                 <shared_ptr[RandomAccessFile]> rd_handle)
 *             out.is_readable = True             # <<<<<<<<<<<<<<
 * 
 *         assert not out.closed
 */
    __pyx_v_out->__pyx_base.is_readable = 1;
  }
  __pyx_L13:;

  /* "pyarrow/io-hdfs.pxi":438
 *             out.is_readable = True
 * 
 *         assert not out.closed             # <<<<<<<<<<<<<<
 * 
 *         if c_buffer_size == 0:
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_closed); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 438, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 438, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!((!__pyx_t_2) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(2, 438, __pyx_L1_error)
    }
  }
  #endif

  /* "pyarrow/io-hdfs.pxi":440
 *         assert not out.closed
 * 
 *         if c_buffer_size == 0:             # <<<<<<<<<<<<<<
 *             c_buffer_size = 2 ** 16
 * 
 */
  __pyx_t_2 = ((__pyx_v_c_buffer_size == 0) != 0);
  if (__pyx_t_2) {

    /* "pyarrow/io-hdfs.pxi":441
 * 
 *         if c_buffer_size == 0:
 *             c_buffer_size = 2 ** 16             # <<<<<<<<<<<<<<
 * 
 *         out.mode = mode
 */
    __pyx_v_c_buffer_size = 0x10000;

    /* "pyarrow/io-hdfs.pxi":440
 *         assert not out.closed
 * 
 *         if c_buffer_size == 0:             # <<<<<<<<<<<<<<
 *             c_buffer_size = 2 ** 16
 * 
 */
  }

  /* "pyarrow/io-hdfs.pxi":443
 *             c_buffer_size = 2 ** 16
 * 
 *         out.mode = mode             # <<<<<<<<<<<<<<
 *         out.buffer_size = c_buffer_size
 *         out.parent = _HdfsFileNanny(self, out)
 */
  __Pyx_INCREF(__pyx_v_mode);
  __Pyx_GIVEREF(__pyx_v_mode);
  __Pyx_GOTREF(__pyx_v_out->mode);
  __Pyx_DECREF(__pyx_v_out->mode);
  __pyx_v_out->mode = __pyx_v_mode;

  /* "pyarrow/io-hdfs.pxi":444
 * 
 *         out.mode = mode
 *         out.buffer_size = c_buffer_size             # <<<<<<<<<<<<<<
 *         out.parent = _HdfsFileNanny(self, out)
 *         out.own_file = True
 */
  __pyx_v_out->buffer_size = __pyx_v_c_buffer_size;

  /* "pyarrow/io-hdfs.pxi":445
 *         out.mode = mode
 *         out.buffer_size = c_buffer_size
 *         out.parent = _HdfsFileNanny(self, out)             # <<<<<<<<<<<<<<
 *         out.own_file = True
 * 
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_out));
  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib__HdfsFileNanny), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_out->parent);
  __Pyx_DECREF(__pyx_v_out->parent);
  __pyx_v_out->parent = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyarrow/io-hdfs.pxi":446
 *         out.buffer_size = c_buffer_size
 *         out.parent = _HdfsFileNanny(self, out)
 *         out.own_file = True             # <<<<<<<<<<<<<<
 * 
 *         return out
 */
  __pyx_v_out->__pyx_base.own_file = 1;

  /* "pyarrow/io-hdfs.pxi":448
 *         out.own_file = True
 * 
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     def download(self, path, stream, buffer_size=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  /* "pyarrow/io-hdfs.pxi":383
 *                          .Delete(c_path, recursive == 1))
 * 
 *     def open(self, path, mode='rb', buffer_size=None, replication=None,             # <<<<<<<<<<<<<<
 *              default_block_size=None):
 *         """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":450
 *         return out
 * 
 *     def download(self, path, stream, buffer_size=None):             # <<<<<<<<<<<<<<
 *         with self.open(path, 'rb') as f:
 *             f.download(stream, buffer_size=buffer_size)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_39download(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_38download[] = "HadoopFileSystem.download(self, path, stream, buffer_size=None)";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_39download(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_stream = 0;
  PyObject *__pyx_v_buffer_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("download (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_stream,&__pyx_n_s_buffer_size,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("download", 0, 2, 3, 1); __PYX_ERR(2, 450, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer_size);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "download") < 0)) __PYX_ERR(2, 450, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_path = values[0];
    __pyx_v_stream = values[1];
    __pyx_v_buffer_size = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("download", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 450, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.download", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_38download(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), __pyx_v_path, __pyx_v_stream, __pyx_v_buffer_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_38download(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_stream, PyObject *__pyx_v_buffer_size) {
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("download", 0);

  /* "pyarrow/io-hdfs.pxi":451
 * 
 *     def download(self, path, stream, buffer_size=None):
 *         with self.open(path, 'rb') as f:             # <<<<<<<<<<<<<<
 *             f.download(stream, buffer_size=buffer_size)
 * 
 */
  /*with:*/ {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_4 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_path, __pyx_n_u_rb_2};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 451, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_path, __pyx_n_u_rb_2};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 451, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 451, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__pyx_t_3) {
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
      }
      __Pyx_INCREF(__pyx_v_path);
      __Pyx_GIVEREF(__pyx_v_path);
      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_path);
      __Pyx_INCREF(__pyx_n_u_rb_2);
      __Pyx_GIVEREF(__pyx_n_u_rb_2);
      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_u_rb_2);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 451, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 451, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 451, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        /*try:*/ {
          __pyx_v_f = __pyx_t_5;
          __pyx_t_5 = 0;

          /* "pyarrow/io-hdfs.pxi":452
 *     def download(self, path, stream, buffer_size=None):
 *         with self.open(path, 'rb') as f:
 *             f.download(stream, buffer_size=buffer_size)             # <<<<<<<<<<<<<<
 * 
 *     def upload(self, path, stream, buffer_size=None):
 */
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_download); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 452, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 452, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_INCREF(__pyx_v_stream);
          __Pyx_GIVEREF(__pyx_v_stream);
          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_stream);
          __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 452, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_buffer_size, __pyx_v_buffer_size) < 0) __PYX_ERR(2, 452, __pyx_L7_error)
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 452, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "pyarrow/io-hdfs.pxi":451
 * 
 *     def download(self, path, stream, buffer_size=None):
 *         with self.open(path, 'rb') as f:             # <<<<<<<<<<<<<<
 *             f.download(stream, buffer_size=buffer_size)
 * 
 */
        }
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L12_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.download", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0) __PYX_ERR(2, 451, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_5 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 451, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 451, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (__pyx_t_11 < 0) __PYX_ERR(2, 451, __pyx_L9_except_error)
          __pyx_t_12 = ((!(__pyx_t_11 != 0)) != 0);
          if (__pyx_t_12) {
            __Pyx_GIVEREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_XGIVEREF(__pyx_t_1);
            __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_2, __pyx_t_1);
            __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; 
            __PYX_ERR(2, 451, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_6) {
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__190, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 451, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L16;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L1_error;
    __pyx_L16:;
  }

  /* "pyarrow/io-hdfs.pxi":450
 *         return out
 * 
 *     def download(self, path, stream, buffer_size=None):             # <<<<<<<<<<<<<<
 *         with self.open(path, 'rb') as f:
 *             f.download(stream, buffer_size=buffer_size)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.download", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":454
 *             f.download(stream, buffer_size=buffer_size)
 * 
 *     def upload(self, path, stream, buffer_size=None):             # <<<<<<<<<<<<<<
 *         """
 *         Upload file-like object to HDFS path
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_41upload(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_40upload[] = "HadoopFileSystem.upload(self, path, stream, buffer_size=None)\n\n        Upload file-like object to HDFS path\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_41upload(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_stream = 0;
  PyObject *__pyx_v_buffer_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("upload (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_stream,&__pyx_n_s_buffer_size,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("upload", 0, 2, 3, 1); __PYX_ERR(2, 454, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer_size);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "upload") < 0)) __PYX_ERR(2, 454, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_path = values[0];
    __pyx_v_stream = values[1];
    __pyx_v_buffer_size = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("upload", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 454, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.upload", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_40upload(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), __pyx_v_path, __pyx_v_stream, __pyx_v_buffer_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_40upload(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_stream, PyObject *__pyx_v_buffer_size) {
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("upload", 0);

  /* "pyarrow/io-hdfs.pxi":458
 *         Upload file-like object to HDFS path
 *         """
 *         with self.open(path, 'wb') as f:             # <<<<<<<<<<<<<<
 *             f.upload(stream, buffer_size=buffer_size)
 * 
 */
  /*with:*/ {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_4 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_path, __pyx_n_u_wb};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 458, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_path, __pyx_n_u_wb};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 458, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 458, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__pyx_t_3) {
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
      }
      __Pyx_INCREF(__pyx_v_path);
      __Pyx_GIVEREF(__pyx_v_path);
      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_path);
      __Pyx_INCREF(__pyx_n_u_wb);
      __Pyx_GIVEREF(__pyx_n_u_wb);
      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_u_wb);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 458, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 458, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 458, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        /*try:*/ {
          __pyx_v_f = __pyx_t_5;
          __pyx_t_5 = 0;

          /* "pyarrow/io-hdfs.pxi":459
 *         """
 *         with self.open(path, 'wb') as f:
 *             f.upload(stream, buffer_size=buffer_size)             # <<<<<<<<<<<<<<
 * 
 * 
 */
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_upload); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 459, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 459, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_INCREF(__pyx_v_stream);
          __Pyx_GIVEREF(__pyx_v_stream);
          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_stream);
          __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 459, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_buffer_size, __pyx_v_buffer_size) < 0) __PYX_ERR(2, 459, __pyx_L7_error)
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 459, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "pyarrow/io-hdfs.pxi":458
 *         Upload file-like object to HDFS path
 *         """
 *         with self.open(path, 'wb') as f:             # <<<<<<<<<<<<<<
 *             f.upload(stream, buffer_size=buffer_size)
 * 
 */
        }
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L12_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.upload", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0) __PYX_ERR(2, 458, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_5 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 458, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 458, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (__pyx_t_11 < 0) __PYX_ERR(2, 458, __pyx_L9_except_error)
          __pyx_t_12 = ((!(__pyx_t_11 != 0)) != 0);
          if (__pyx_t_12) {
            __Pyx_GIVEREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_XGIVEREF(__pyx_t_1);
            __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_2, __pyx_t_1);
            __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; 
            __PYX_ERR(2, 458, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_6) {
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__190, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 458, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L16;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L1_error;
    __pyx_L16:;
  }

  /* "pyarrow/io-hdfs.pxi":454
 *             f.download(stream, buffer_size=buffer_size)
 * 
 *     def upload(self, path, stream, buffer_size=None):             # <<<<<<<<<<<<<<
 *         """
 *         Upload file-like object to HDFS path
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.upload", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":61
 * 
 *     cdef readonly:
 *         bint is_open             # <<<<<<<<<<<<<<
 *         object host
 *         object user
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_7is_open_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_7is_open_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_7is_open___get__(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_7is_open___get__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->is_open); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.is_open.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":62
 *     cdef readonly:
 *         bint is_open
 *         object host             # <<<<<<<<<<<<<<
 *         object user
 *         object kerb_ticket
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_4host_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_4host_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_4host___get__(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_4host___get__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->host);
  __pyx_r = __pyx_v_self->host;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":63
 *         bint is_open
 *         object host
 *         object user             # <<<<<<<<<<<<<<
 *         object kerb_ticket
 *         object driver
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_4user_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_4user_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_4user___get__(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_4user___get__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->user);
  __pyx_r = __pyx_v_self->user;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":64
 *         object host
 *         object user
 *         object kerb_ticket             # <<<<<<<<<<<<<<
 *         object driver
 *         int port
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_11kerb_ticket_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_11kerb_ticket_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_11kerb_ticket___get__(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_11kerb_ticket___get__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->kerb_ticket);
  __pyx_r = __pyx_v_self->kerb_ticket;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":65
 *         object user
 *         object kerb_ticket
 *         object driver             # <<<<<<<<<<<<<<
 *         int port
 *         dict extra_conf
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_6driver_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_6driver_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_6driver___get__(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_6driver___get__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->driver);
  __pyx_r = __pyx_v_self->driver;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":66
 *         object kerb_ticket
 *         object driver
 *         int port             # <<<<<<<<<<<<<<
 *         dict extra_conf
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_4port_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_4port_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_4port___get__(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_4port___get__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->port); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.port.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":67
 *         object driver
 *         int port
 *         dict extra_conf             # <<<<<<<<<<<<<<
 * 
 *     def _connect(self, host, port, user, kerb_ticket, driver, extra_conf):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_10extra_conf_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_10extra_conf_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_10extra_conf___get__(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_10extra_conf___get__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->extra_conf);
  __pyx_r = __pyx_v_self->extra_conf;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.client cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_43__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_42__reduce_cython__[] = "HadoopFileSystem.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_43__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_42__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_42__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.client cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.client cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__191, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__192, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.client cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.client cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":471
 *         object file_handle_ref
 * 
 *     def __cinit__(self, client, file_handle):             # <<<<<<<<<<<<<<
 *         import weakref
 *         self.client = client
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_14_HdfsFileNanny_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_14_HdfsFileNanny_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_client = 0;
  PyObject *__pyx_v_file_handle = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_client,&__pyx_n_s_file_handle,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_client)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_file_handle)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(2, 471, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 471, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_client = values[0];
    __pyx_v_file_handle = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 471, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._HdfsFileNanny.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_HdfsFileNanny___cinit__(((struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *)__pyx_v_self), __pyx_v_client, __pyx_v_file_handle);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_14_HdfsFileNanny___cinit__(struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *__pyx_v_self, PyObject *__pyx_v_client, PyObject *__pyx_v_file_handle) {
  PyObject *__pyx_v_weakref = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/io-hdfs.pxi":472
 * 
 *     def __cinit__(self, client, file_handle):
 *         import weakref             # <<<<<<<<<<<<<<
 *         self.client = client
 *         self.file_handle_ref = weakref.ref(file_handle)
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_weakref, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_weakref = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":473
 *     def __cinit__(self, client, file_handle):
 *         import weakref
 *         self.client = client             # <<<<<<<<<<<<<<
 *         self.file_handle_ref = weakref.ref(file_handle)
 * 
 */
  __Pyx_INCREF(__pyx_v_client);
  __Pyx_GIVEREF(__pyx_v_client);
  __Pyx_GOTREF(__pyx_v_self->client);
  __Pyx_DECREF(__pyx_v_self->client);
  __pyx_v_self->client = __pyx_v_client;

  /* "pyarrow/io-hdfs.pxi":474
 *         import weakref
 *         self.client = client
 *         self.file_handle_ref = weakref.ref(file_handle)             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_weakref, __pyx_n_s_ref); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_file_handle) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_file_handle);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->file_handle_ref);
  __Pyx_DECREF(__pyx_v_self->file_handle_ref);
  __pyx_v_self->file_handle_ref = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":471
 *         object file_handle_ref
 * 
 *     def __cinit__(self, client, file_handle):             # <<<<<<<<<<<<<<
 *         import weakref
 *         self.client = client
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib._HdfsFileNanny.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_weakref);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":476
 *         self.file_handle_ref = weakref.ref(file_handle)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         fh = self.file_handle_ref()
 *         if fh:
 */

/* Python wrapper */
static void __pyx_pw_7pyarrow_3lib_14_HdfsFileNanny_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7pyarrow_3lib_14_HdfsFileNanny_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7pyarrow_3lib_14_HdfsFileNanny_2__dealloc__(((struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_7pyarrow_3lib_14_HdfsFileNanny_2__dealloc__(struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *__pyx_v_self) {
  PyObject *__pyx_v_fh = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pyarrow/io-hdfs.pxi":477
 * 
 *     def __dealloc__(self):
 *         fh = self.file_handle_ref()             # <<<<<<<<<<<<<<
 *         if fh:
 *             fh.close()
 */
  __Pyx_INCREF(__pyx_v_self->file_handle_ref);
  __pyx_t_2 = __pyx_v_self->file_handle_ref; __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_fh = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":478
 *     def __dealloc__(self):
 *         fh = self.file_handle_ref()
 *         if fh:             # <<<<<<<<<<<<<<
 *             fh.close()
 *         # avoid cyclic GC
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_fh); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 478, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "pyarrow/io-hdfs.pxi":479
 *         fh = self.file_handle_ref()
 *         if fh:
 *             fh.close()             # <<<<<<<<<<<<<<
 *         # avoid cyclic GC
 *         self.file_handle_ref = None
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fh, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 479, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 479, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/io-hdfs.pxi":478
 *     def __dealloc__(self):
 *         fh = self.file_handle_ref()
 *         if fh:             # <<<<<<<<<<<<<<
 *             fh.close()
 *         # avoid cyclic GC
 */
  }

  /* "pyarrow/io-hdfs.pxi":481
 *             fh.close()
 *         # avoid cyclic GC
 *         self.file_handle_ref = None             # <<<<<<<<<<<<<<
 *         self.client = None
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->file_handle_ref);
  __Pyx_DECREF(__pyx_v_self->file_handle_ref);
  __pyx_v_self->file_handle_ref = Py_None;

  /* "pyarrow/io-hdfs.pxi":482
 *         # avoid cyclic GC
 *         self.file_handle_ref = None
 *         self.client = None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->client);
  __Pyx_DECREF(__pyx_v_self->client);
  __pyx_v_self->client = Py_None;

  /* "pyarrow/io-hdfs.pxi":476
 *         self.file_handle_ref = weakref.ref(file_handle)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         fh = self.file_handle_ref()
 *         if fh:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("pyarrow.lib._HdfsFileNanny.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fh);
  __Pyx_RefNannyFinishContext();
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_HdfsFileNanny_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_HdfsFileNanny_4__reduce_cython__[] = "_HdfsFileNanny.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_HdfsFileNanny_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_HdfsFileNanny_4__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_HdfsFileNanny_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__193, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__194, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._HdfsFileNanny.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":491
 *         object parent
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         self.parent = None
 */

/* Python wrapper */
static void __pyx_pw_7pyarrow_3lib_8HdfsFile_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7pyarrow_3lib_8HdfsFile_1__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7pyarrow_3lib_8HdfsFile___dealloc__(((struct __pyx_obj_7pyarrow_3lib_HdfsFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_7pyarrow_3lib_8HdfsFile___dealloc__(struct __pyx_obj_7pyarrow_3lib_HdfsFile *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pyarrow/io-hdfs.pxi":492
 * 
 *     def __dealloc__(self):
 *         self.parent = None             # <<<<<<<<<<<<<<
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->parent);
  __Pyx_DECREF(__pyx_v_self->parent);
  __pyx_v_self->parent = Py_None;

  /* "pyarrow/io-hdfs.pxi":491
 *         object parent
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         self.parent = None
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/io-hdfs.pxi":487
 * cdef class HdfsFile(NativeFile):
 *     cdef readonly:
 *         int32_t buffer_size             # <<<<<<<<<<<<<<
 *         object mode
 *         object parent
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8HdfsFile_11buffer_size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_8HdfsFile_11buffer_size_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8HdfsFile_11buffer_size___get__(((struct __pyx_obj_7pyarrow_3lib_HdfsFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8HdfsFile_11buffer_size___get__(struct __pyx_obj_7pyarrow_3lib_HdfsFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_self->buffer_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 487, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.HdfsFile.buffer_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":488
 *     cdef readonly:
 *         int32_t buffer_size
 *         object mode             # <<<<<<<<<<<<<<
 *         object parent
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8HdfsFile_4mode_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_8HdfsFile_4mode_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8HdfsFile_4mode___get__(((struct __pyx_obj_7pyarrow_3lib_HdfsFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8HdfsFile_4mode___get__(struct __pyx_obj_7pyarrow_3lib_HdfsFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->mode);
  __pyx_r = __pyx_v_self->mode;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":489
 *         int32_t buffer_size
 *         object mode
 *         object parent             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8HdfsFile_6parent_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_8HdfsFile_6parent_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8HdfsFile_6parent___get__(((struct __pyx_obj_7pyarrow_3lib_HdfsFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8HdfsFile_6parent___get__(struct __pyx_obj_7pyarrow_3lib_HdfsFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->parent);
  __pyx_r = __pyx_v_self->parent;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8HdfsFile_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_8HdfsFile_2__reduce_cython__[] = "HdfsFile.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_8HdfsFile_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8HdfsFile_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_HdfsFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8HdfsFile_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_HdfsFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__195, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__196, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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_u_Do_not_call_s_constructor_direct_8, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 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(7, 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(7, 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(7, 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(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/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(7, 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(7, 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(7, 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(7, 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(7, 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(7, 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(7, 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(7, 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(7, 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;
  std::shared_ptr<arrow::io::OutputStream>  __pyx_v_handle;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int32_t __pyx_t_2;
  std::shared_ptr<arrow::io::OutputStream>  __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = 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(7, 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             # <<<<<<<<<<<<<<
 * 
 *         handle = stream.get_output_stream()
 */
  __pyx_t_2 = __Pyx_PyInt_As_int32_t(__pyx_v_alignment); if (unlikely((__pyx_t_2 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 81, __pyx_L1_error)
  __pyx_v_c_alignment = __pyx_t_2;

  /* "pyarrow/ipc.pxi":83
 *             int32_t c_alignment = alignment
 * 
 *         handle = stream.get_output_stream()             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.message.get()
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_7pyarrow_3lib_BufferOutputStream *)__pyx_v_stream->__pyx_base.__pyx_vtab)->__pyx_base.get_output_stream(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_stream)); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 83, __pyx_L1_error)
  __pyx_v_handle = __pyx_t_3;

  /* "pyarrow/ipc.pxi":84
 * 
 *         handle = stream.get_output_stream()
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.message.get()
 *                          .SerializeTo(handle.get(), c_alignment,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":85
 *         handle = stream.get_output_stream()
 *         with nogil:
 *             check_status(self.message.get()             # <<<<<<<<<<<<<<
 *                          .SerializeTo(handle.get(), c_alignment,
 *                                       &output_length))
 */
        __pyx_t_4 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->message.get()->SerializeTo(__pyx_v_handle.get(), __pyx_v_c_alignment, (&__pyx_v_output_length))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(7, 85, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":84
 * 
 *         handle = stream.get_output_stream()
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.message.get()
 *                          .SerializeTo(handle.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":88
 *                          .SerializeTo(handle.get(), c_alignment,
 *                                       &output_length))
 *         return stream.getvalue()             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_stream), __pyx_n_s_getvalue); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 88, __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_1 = (__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_1)) __PYX_ERR(7, 88, __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/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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __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":90
 *         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":91
 * 
 *     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(7, 91, __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(7, 91, __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":92
 *     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(7, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_body = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/ipc.pxi":93
 *         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(7, 93, __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":95
 *         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":98
 * type: {0}
 * metadata length: {1}
 * body length: {2}""".format(self.type, metadata_len, body_len)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_pyarrow_Message_type_0_metadata, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 98, __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(7, 98, __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(7, 98, __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(7, 98, __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(7, 98, __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(7, 98, __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":90
 *         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__197, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__198, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":109
 *         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":112
 *         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":115
 *         raise TypeError("Do not call {}'s constructor directly, use "
 *                         "`pyarrow.ipc.MessageReader.open_stream` function "
 *                         "instead.".format(self.__class__.__name__))             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Do_not_call_s_constructor_direct_9, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 115, __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, 115, __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, 115, __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, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/ipc.pxi":113
 * 
 *     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(7, 113, __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, 113, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":112
 *         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":118
 * 
 *     @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(7, 118, __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(7, 118, __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":119
 *     @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(7, 119, __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":122
 *         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(7, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/ipc.pxi":123
 *         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":124
 *         _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":125
 *         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":123
 *         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":127
 *             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":118
 * 
 *     @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":129
 *         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_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(7, 129, __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(7, 129, __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_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(7, 129, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":130
 * 
 *     def __iter__(self):
 *         while True:             # <<<<<<<<<<<<<<
 *             yield self.read_next_message()
 * 
 */
  while (1) {

    /* "pyarrow/ipc.pxi":131
 *     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(7, 131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 131, __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(7, 131, __pyx_L1_error)
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/ipc.pxi":129
 *         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":133
 *             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":138
 *         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(7, 138, __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":140
 *         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":141
 * 
 *         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(7, 141, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":140
 *         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":143
 *             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":144
 * 
 *         if result.message.get() == NULL:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
    __PYX_ERR(7, 144, __pyx_L1_error)

    /* "pyarrow/ipc.pxi":143
 *             check_status(self.reader.get().ReadNextMessage(&result.message))
 * 
 *         if result.message.get() == NULL:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 * 
 */
  }

  /* "pyarrow/ipc.pxi":146
 *             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":133
 *             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__199, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__200, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":160
 *     # cdef block is in lib.pxd
 * 
 *     def write(self, table_or_batch):             # <<<<<<<<<<<<<<
 *         """
 *         Write RecordBatch or Table to stream
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_1write(PyObject *__pyx_v_self, PyObject *__pyx_v_table_or_batch); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_write[] = "_CRecordBatchWriter.write(self, table_or_batch)\n\n        Write RecordBatch or Table to stream\n\n        Parameters\n        ----------\n        table_or_batch : {RecordBatch, Table}\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_1write(PyObject *__pyx_v_self, PyObject *__pyx_v_table_or_batch) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_write(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *)__pyx_v_self), ((PyObject *)__pyx_v_table_or_batch));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_write(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self, PyObject *__pyx_v_table_or_batch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("write", 0);

  /* "pyarrow/ipc.pxi":168
 *         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":169
 *         """
 *         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(7, 169, __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(7, 169, __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":168
 *         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":170
 *         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":171
 *             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(7, 171, __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(7, 171, __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":170
 *         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":173
 *             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(7, 173, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(7, 173, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/ipc.pxi":160
 *     # cdef block is in lib.pxd
 * 
 *     def write(self, table_or_batch):             # <<<<<<<<<<<<<<
 *         """
 *         Write RecordBatch or Table to stream
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchWriter.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":175
 *             raise ValueError(type(table_or_batch))
 * 
 *     def write_batch(self, RecordBatch batch):             # <<<<<<<<<<<<<<
 *         """
 *         Write RecordBatch to stream
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_3write_batch(PyObject *__pyx_v_self, PyObject *__pyx_v_batch); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_2write_batch[] = "_CRecordBatchWriter.write_batch(self, RecordBatch batch)\n\n        Write RecordBatch to stream\n\n        Parameters\n        ----------\n        batch : RecordBatch\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_3write_batch(PyObject *__pyx_v_self, PyObject *__pyx_v_batch) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_batch (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_batch), __pyx_ptype_7pyarrow_3lib_RecordBatch, 1, "batch", 0))) __PYX_ERR(7, 175, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_2write_batch(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_batch));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_2write_batch(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_batch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("write_batch", 0);

  /* "pyarrow/ipc.pxi":183
 *         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":184
 *         """
 *         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(7, 184, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":183
 *         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":175
 *             raise ValueError(type(table_or_batch))
 * 
 *     def write_batch(self, RecordBatch batch):             # <<<<<<<<<<<<<<
 *         """
 *         Write RecordBatch to stream
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchWriter.write_batch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":187
 *                          .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_19_CRecordBatchWriter_5write_table(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_4write_table[] = "_CRecordBatchWriter.write_table(self, Table table, chunksize=None)\n\n        Write RecordBatch to stream\n\n        Parameters\n        ----------\n        batch : RecordBatch\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_5write_table(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_table = 0;
  PyObject *__pyx_v_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(7, 187, __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(7, 187, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchWriter.write_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_table), __pyx_ptype_7pyarrow_3lib_Table, 1, "table", 0))) __PYX_ERR(7, 187, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_4write_table(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *)__pyx_v_self), __pyx_v_table, __pyx_v_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_19_CRecordBatchWriter_4write_table(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_table, PyObject *__pyx_v_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":197
 *         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":199
 *             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":200
 * 
 *         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(7, 200, __pyx_L1_error)
    __pyx_v_c_chunksize = __pyx_t_3;

    /* "pyarrow/ipc.pxi":199
 *             int64_t c_chunksize = -1
 * 
 *         if chunksize is not None:             # <<<<<<<<<<<<<<
 *             c_chunksize = chunksize
 * 
 */
  }

  /* "pyarrow/ipc.pxi":202
 *             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":203
 * 
 *         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(7, 203, __pyx_L5_error)
      }

      /* "pyarrow/ipc.pxi":202
 *             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":187
 *                          .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._CRecordBatchWriter.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":206
 *                                                       c_chunksize))
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         """
 *         Close stream and write end-of-stream 0 marker
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_7close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_6close[] = "_CRecordBatchWriter.close(self)\n\n        Close stream and write end-of-stream 0 marker\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_7close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_6close(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_6close(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("close", 0);

  /* "pyarrow/ipc.pxi":210
 *         Close stream and write end-of-stream 0 marker
 *         """
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.writer.get().Close())
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":211
 *         """
 *         with nogil:
 *             check_status(self.writer.get().Close())             # <<<<<<<<<<<<<<
 * 
 *     def __enter__(self):
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->writer.get()->Close()); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 211, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":210
 *         Close stream and write end-of-stream 0 marker
 *         """
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.writer.get().Close())
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":206
 *                                                       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._CRecordBatchWriter.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":213
 *             check_status(self.writer.get().Close())
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_9__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_8__enter__[] = "_CRecordBatchWriter.__enter__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_9__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_8__enter__(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_8__enter__(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__", 0);

  /* "pyarrow/ipc.pxi":214
 * 
 *     def __enter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":213
 *             check_status(self.writer.get().Close())
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":216
 *         return self
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
 *         self.close()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_11__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_10__exit__[] = "_CRecordBatchWriter.__exit__(self, exc_type, exc_val, exc_tb)";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_11__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_exc_type = 0;
  CYTHON_UNUSED PyObject *__pyx_v_exc_val = 0;
  CYTHON_UNUSED PyObject *__pyx_v_exc_tb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exc_type,&__pyx_n_s_exc_val,&__pyx_n_s_exc_tb,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_val)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(7, 216, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_tb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(7, 216, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(7, 216, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_exc_type = values[0];
    __pyx_v_exc_val = values[1];
    __pyx_v_exc_tb = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 216, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchWriter.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_10__exit__(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *)__pyx_v_self), __pyx_v_exc_type, __pyx_v_exc_val, __pyx_v_exc_tb);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_10__exit__(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_val, CYTHON_UNUSED PyObject *__pyx_v_exc_tb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__exit__", 0);

  /* "pyarrow/ipc.pxi":217
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):
 *         self.close()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 217, __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":216
 *         return self
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
 *         self.close()
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchWriter.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_12__reduce_cython__[] = "_CRecordBatchWriter.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_12__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__201, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchWriter.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_14__setstate_cython__[] = "_CRecordBatchWriter.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_14__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__202, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchWriter.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":225
 *         bint closed
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter___cinit__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":228
 *         pass
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static void __pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_2__dealloc__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_2__dealloc__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/ipc.pxi":231
 *         pass
 * 
 *     def _open(self, sink, Schema schema):             # <<<<<<<<<<<<<<
 *         get_writer(sink, &self.sink)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_5_open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamWriter_4_open[] = "_RecordBatchStreamWriter._open(self, sink, Schema schema)";
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_5_open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_sink = 0;
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema = 0;
  PyObject *__pyx_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(7, 231, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_open") < 0)) __PYX_ERR(7, 231, __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(7, 231, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchStreamWriter._open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), __pyx_ptype_7pyarrow_3lib_Schema, 1, "schema", 0))) __PYX_ERR(7, 231, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_4_open(((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *)__pyx_v_self), __pyx_v_sink, __pyx_v_schema);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_4_open(struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *__pyx_v_self, PyObject *__pyx_v_sink, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("_open", 0);

  /* "pyarrow/ipc.pxi":232
 * 
 *     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(7, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/ipc.pxi":234
 *         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":235
 * 
 *         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->__pyx_base.writer))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(7, 235, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":234
 *         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":231
 *         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._RecordBatchStreamWriter._open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamWriter_6__reduce_cython__[] = "_RecordBatchStreamWriter.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_6__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__203, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchStreamWriter.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamWriter_8__setstate_cython__[] = "_RecordBatchStreamWriter.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_8__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__204, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchStreamWriter.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":241
 * 
 * 
 * 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":245
 *         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":246
 * 
 *     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(7, 246, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_source);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 246, __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":245
 *         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_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/ipc.pxi":247
 *     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":245
 *         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":251
 *         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(7, 251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/ipc.pxi":252
 * 
 *     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":241
 * 
 * 
 * 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;
}
static PyObject *__pyx_gb_7pyarrow_3lib_19_CRecordBatchReader_2generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/ipc.pxi":264
 *     # cdef block is in lib.pxd
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         while True:
 *             yield self.read_next_batch()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_1__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_1__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchReader___iter__(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader___iter__(struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12___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_12___iter__ *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_12___iter__(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_12___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(7, 264, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_3lib_19_CRecordBatchReader_2generator9, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_CRecordBatchReader___iter, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(7, 264, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchReader.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7pyarrow_3lib_19_CRecordBatchReader_2generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12___iter__ *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12___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(7, 264, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":265
 * 
 *     def __iter__(self):
 *         while True:             # <<<<<<<<<<<<<<
 *             yield self.read_next_batch()
 * 
 */
  while (1) {

    /* "pyarrow/ipc.pxi":266
 *     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(7, 266, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 266, __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(7, 266, __pyx_L1_error)
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/ipc.pxi":264
 *     # cdef block is in lib.pxd
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         while True:
 *             yield self.read_next_batch()
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":268
 *             yield self.read_next_batch()
 * 
 *     def get_next_batch(self):             # <<<<<<<<<<<<<<
 *         import warnings
 *         warnings.warn('Please use read_next_batch instead of '
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_4get_next_batch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchReader_3get_next_batch[] = "_CRecordBatchReader.get_next_batch(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_4get_next_batch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_next_batch (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_3get_next_batch(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_3get_next_batch(struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self) {
  PyObject *__pyx_v_warnings = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("get_next_batch", 0);

  /* "pyarrow/ipc.pxi":269
 * 
 *     def get_next_batch(self):
 *         import warnings             # <<<<<<<<<<<<<<
 *         warnings.warn('Please use read_next_batch instead of '
 *                       'get_next_batch', FutureWarning)
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_warnings = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/ipc.pxi":270
 *     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(7, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/ipc.pxi":271
 *         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__205, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 270, __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":272
 *         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(7, 272, __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(7, 272, __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":268
 *             yield self.read_next_batch()
 * 
 *     def get_next_batch(self):             # <<<<<<<<<<<<<<
 *         import warnings
 *         warnings.warn('Please use read_next_batch instead of '
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchReader.get_next_batch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_warnings);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":274
 *         return self.read_next_batch()
 * 
 *     def read_next_batch(self):             # <<<<<<<<<<<<<<
 *         """
 *         Read next RecordBatch from the stream. Raises StopIteration at end of
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_6read_next_batch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchReader_5read_next_batch[] = "_CRecordBatchReader.read_next_batch(self)\n\n        Read next RecordBatch from the stream. Raises StopIteration at end of\n        stream\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_6read_next_batch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_next_batch (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_5read_next_batch(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_5read_next_batch(struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self) {
  std::shared_ptr< arrow::RecordBatch>  __pyx_v_batch;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("read_next_batch", 0);

  /* "pyarrow/ipc.pxi":281
 *         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":282
 * 
 *         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(7, 282, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":281
 *         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":284
 *             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":285
 * 
 *         if batch.get() == NULL:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_batch(batch)
 */
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
    __PYX_ERR(7, 285, __pyx_L1_error)

    /* "pyarrow/ipc.pxi":284
 *             check_status(self.reader.get().ReadNext(&batch))
 * 
 *         if batch.get() == NULL:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 * 
 */
  }

  /* "pyarrow/ipc.pxi":287
 *             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(7, 287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":274
 *         return self.read_next_batch()
 * 
 *     def read_next_batch(self):             # <<<<<<<<<<<<<<
 *         """
 *         Read next RecordBatch from the stream. Raises StopIteration at end of
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchReader.read_next_batch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":289
 *         return pyarrow_wrap_batch(batch)
 * 
 *     def read_all(self):             # <<<<<<<<<<<<<<
 *         """
 *         Read all record batches as a pyarrow.Table
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_8read_all(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchReader_7read_all[] = "_CRecordBatchReader.read_all(self)\n\n        Read all record batches as a pyarrow.Table\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_8read_all(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_all (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_7read_all(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_7read_all(struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self) {
  std::shared_ptr< arrow::Table>  __pyx_v_table;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("read_all", 0);

  /* "pyarrow/ipc.pxi":294
 *         """
 *         cdef shared_ptr[CTable] table
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get().ReadAll(&table))
 *         return pyarrow_wrap_table(table)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":295
 *         cdef shared_ptr[CTable] table
 *         with nogil:
 *             check_status(self.reader.get().ReadAll(&table))             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_table(table)
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->reader.get()->ReadAll((&__pyx_v_table))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 295, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":294
 *         """
 *         cdef shared_ptr[CTable] table
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get().ReadAll(&table))
 *         return pyarrow_wrap_table(table)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":296
 *         with nogil:
 *             check_status(self.reader.get().ReadAll(&table))
 *         return pyarrow_wrap_table(table)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_table); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":289
 *         return pyarrow_wrap_batch(batch)
 * 
 *     def read_all(self):             # <<<<<<<<<<<<<<
 *         """
 *         Read all record batches as a pyarrow.Table
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchReader.read_all", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_10__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchReader_9__reduce_cython__[] = "_CRecordBatchReader.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_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_19_CRecordBatchReader_9__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_9__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__206, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchReader.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_12__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchReader_11__setstate_cython__[] = "_CRecordBatchReader.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_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_19_CRecordBatchReader_11__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_11__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__207, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchReader.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":306
 *         Schema schema
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader___cinit__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":309
 *         pass
 * 
 *     def _open(self, source):             # <<<<<<<<<<<<<<
 *         _get_input_stream(source, &self.in_stream)
 *         with nogil:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_3_open(PyObject *__pyx_v_self, PyObject *__pyx_v_source); /*proto*/
static char __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamReader_2_open[] = "_RecordBatchStreamReader._open(self, source)";
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_3_open(PyObject *__pyx_v_self, PyObject *__pyx_v_source) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_open (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_2_open(((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *)__pyx_v_self), ((PyObject *)__pyx_v_source));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_2_open(struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *__pyx_v_self, PyObject *__pyx_v_source) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("_open", 0);

  /* "pyarrow/ipc.pxi":310
 * 
 *     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(7, 310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/ipc.pxi":311
 *     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":312
 *         _get_input_stream(source, &self.in_stream)
 *         with nogil:
 *             check_status(CRecordBatchStreamReader.Open(             # <<<<<<<<<<<<<<
 *                 self.in_stream.get(), &self.reader))
 * 
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status( arrow::ipc::RecordBatchStreamReader::Open(__pyx_v_self->in_stream.get(), (&__pyx_v_self->__pyx_base.reader))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(7, 312, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":311
 *     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":315
 *                 self.in_stream.get(), &self.reader))
 * 
 *         self.schema = pyarrow_wrap_schema(self.reader.get().schema())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_self->__pyx_base.reader.get()->schema()); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 315, __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(7, 315, __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":309
 *         pass
 * 
 *     def _open(self, source):             # <<<<<<<<<<<<<<
 *         _get_input_stream(source, &self.in_stream)
 *         with nogil:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchStreamReader._open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":304
 * 
 *     cdef readonly:
 *         Schema schema             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_6schema_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_6schema_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_6schema___get__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_6schema___get__(struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->schema));
  __pyx_r = ((PyObject *)__pyx_v_self->schema);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamReader_4__reduce_cython__[] = "_RecordBatchStreamReader.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_4__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__208, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchStreamReader.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamReader_6__setstate_cython__[] = "_RecordBatchStreamReader.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_6__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__209, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchStreamReader.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":320
 * cdef class _RecordBatchFileWriter(_RecordBatchStreamWriter):
 * 
 *     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(7, 320, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_open") < 0)) __PYX_ERR(7, 320, __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(7, 320, __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(7, 320, __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":321
 * 
 *     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(7, 321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/ipc.pxi":323
 *         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":324
 * 
 *         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.__pyx_base.writer))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(7, 324, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":323
 *         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
 * cdef class _RecordBatchFileWriter(_RecordBatchStreamWriter):
 * 
 *     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__210, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__211, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":337
 *         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":340
 *         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(7, 340, __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(7, 340, __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":341
 * 
 *     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":342
 *     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(7, 342, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_source);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 342, __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":341
 * 
 *     def _open(self, source, footer_offset=None):
 *         try:             # <<<<<<<<<<<<<<
 *             source = as_buffer(source)
 *         except TypeError:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/ipc.pxi":343
 *         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":341
 * 
 *     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":346
 *             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(7, 346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/ipc.pxi":348
 *         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":349
 * 
 *         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":350
 *         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(7, 350, __pyx_L1_error)
    __pyx_v_offset = __pyx_t_10;

    /* "pyarrow/ipc.pxi":349
 * 
 *         cdef int64_t offset = 0
 *         if footer_offset is not None:             # <<<<<<<<<<<<<<
 *             offset = footer_offset
 * 
 */
  }

  /* "pyarrow/ipc.pxi":352
 *             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":353
 * 
 *         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":354
 *         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(7, 354, __pyx_L11_error)

          /* "pyarrow/ipc.pxi":353
 * 
 *         with nogil:
 *             if offset != 0:             # <<<<<<<<<<<<<<
 *                 check_status(
 *                     CRecordBatchFileReader.Open2(self.file.get(), offset,
 */
          goto __pyx_L13;
        }

        /* "pyarrow/ipc.pxi":358
 *                                                  &self.reader))
 *             else:
 *                 check_status(             # <<<<<<<<<<<<<<
 *                     CRecordBatchFileReader.Open(self.file.get(), &self.reader))
 * 
 */
        /*else*/ {

          /* "pyarrow/ipc.pxi":359
 *             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(7, 358, __pyx_L11_error)
        }
        __pyx_L13:;
      }

      /* "pyarrow/ipc.pxi":352
 *             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":361
 *                     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(7, 361, __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(7, 361, __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":340
 *         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":364
 * 
 *     @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":365
 *     @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(7, 365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":364
 * 
 *     @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":367
 *         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(7, 367, __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":370
 *         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(7, 370, __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(7, 370, __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(7, 370, __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(7, 370, __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":371
 * 
 *         if i < 0 or i >= self.num_record_batches:
 *             raise ValueError('Batch number {0} out of range'.format(i))             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Batch_number_0_out_of_range, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 371, __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(7, 371, __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(7, 371, __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(7, 371, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(7, 371, __pyx_L1_error)

    /* "pyarrow/ipc.pxi":370
 *         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":373
 *             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":374
 * 
 *         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(7, 374, __pyx_L7_error)
      }

      /* "pyarrow/ipc.pxi":373
 *             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":376
 *             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(7, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":367
 *         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":382
 *     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":391
 *             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(7, 391, __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(7, 391, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_nbatches = __pyx_t_2;

  /* "pyarrow/ipc.pxi":393
 *         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(7, 393, __pyx_L1_error)
  }

  /* "pyarrow/ipc.pxi":394
 * 
 *         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":395
 *         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":396
 *         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(7, 396, __pyx_L4_error)
        }

        /* "pyarrow/ipc.pxi":397
 *             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(7, 397, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":394
 * 
 *         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":400
 *                                                   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(7, 400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":382
 *     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":335
 * 
 *     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__212, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__213, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":403
 * 
 * 
 * def get_tensor_size(Tensor tensor):             # <<<<<<<<<<<<<<
 *     """
 *     Return total size of serialized Tensor including metadata and padding
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_139get_tensor_size(PyObject *__pyx_self, PyObject *__pyx_v_tensor); /*proto*/
static char __pyx_doc_7pyarrow_3lib_138get_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_139get_tensor_size = {"get_tensor_size", (PyCFunction)__pyx_pw_7pyarrow_3lib_139get_tensor_size, METH_O, __pyx_doc_7pyarrow_3lib_138get_tensor_size};
static PyObject *__pyx_pw_7pyarrow_3lib_139get_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(7, 403, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_138get_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_138get_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":408
 *     """
 *     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":409
 *     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(7, 409, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":408
 *     """
 *     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":410
 *     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(7, 410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":403
 * 
 * 
 * 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":413
 * 
 * 
 * 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_141get_record_batch_size(PyObject *__pyx_self, PyObject *__pyx_v_batch); /*proto*/
static char __pyx_doc_7pyarrow_3lib_140get_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_141get_record_batch_size = {"get_record_batch_size", (PyCFunction)__pyx_pw_7pyarrow_3lib_141get_record_batch_size, METH_O, __pyx_doc_7pyarrow_3lib_140get_record_batch_size};
static PyObject *__pyx_pw_7pyarrow_3lib_141get_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(7, 413, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_140get_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_140get_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":418
 *     """
 *     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":419
 *     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(7, 419, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":418
 *     """
 *     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":420
 *     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(7, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":413
 * 
 * 
 * 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":423
 * 
 * 
 * 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_143write_tensor(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_142write_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_143write_tensor = {"write_tensor", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_143write_tensor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_142write_tensor};
static PyObject *__pyx_pw_7pyarrow_3lib_143write_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(7, 423, __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(7, 423, __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(7, 423, __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(7, 423, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dest), __pyx_ptype_7pyarrow_3lib_NativeFile, 1, "dest", 0))) __PYX_ERR(7, 423, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_142write_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_142write_tensor(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_tensor, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_dest) {
  int32_t __pyx_v_metadata_length;
  int64_t __pyx_v_body_length;
  std::shared_ptr<arrow::io::OutputStream>  __pyx_v_handle;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr<arrow::io::OutputStream>  __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("write_tensor", 0);

  /* "pyarrow/ipc.pxi":441
 *         int64_t body_length
 * 
 *     handle = dest.get_output_stream()             # <<<<<<<<<<<<<<
 * 
 *     with nogil:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_dest->__pyx_vtab)->get_output_stream(__pyx_v_dest); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 441, __pyx_L1_error)
  __pyx_v_handle = __pyx_t_1;

  /* "pyarrow/ipc.pxi":443
 *     handle = dest.get_output_stream()
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(
 *             WriteTensor(deref(tensor.tp), handle.get(),
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":444
 * 
 *     with nogil:
 *         check_status(             # <<<<<<<<<<<<<<
 *             WriteTensor(deref(tensor.tp), handle.get(),
 *                         &metadata_length, &body_length))
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(arrow::ipc::WriteTensor((*__pyx_v_tensor->tp), __pyx_v_handle.get(), (&__pyx_v_metadata_length), (&__pyx_v_body_length))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(7, 444, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":443
 *     handle = dest.get_output_stream()
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(
 *             WriteTensor(deref(tensor.tp), handle.get(),
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":448
 *                         &metadata_length, &body_length))
 * 
 *     return metadata_length + body_length             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyInt_From_int64_t((__pyx_v_metadata_length + __pyx_v_body_length)); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":423
 * 
 * 
 * def write_tensor(Tensor tensor, NativeFile dest):             # <<<<<<<<<<<<<<
 *     """
 *     Write pyarrow.Tensor to pyarrow.NativeFile object its current position
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.write_tensor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":451
 * 
 * 
 * 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_145read_tensor(PyObject *__pyx_self, PyObject *__pyx_v_source); /*proto*/
static char __pyx_doc_7pyarrow_3lib_144read_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_145read_tensor = {"read_tensor", (PyCFunction)__pyx_pw_7pyarrow_3lib_145read_tensor, METH_O, __pyx_doc_7pyarrow_3lib_144read_tensor};
static PyObject *__pyx_pw_7pyarrow_3lib_145read_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(7, 451, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_144read_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_144read_tensor(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_source) {
  std::shared_ptr< arrow::Tensor>  __pyx_v_sp_tensor;
  arrow::io::RandomAccessFile *__pyx_v_rd_file;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr<arrow::io::RandomAccessFile>  __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("read_tensor", 0);

  /* "pyarrow/ipc.pxi":470
 *         RandomAccessFile* rd_file
 * 
 *     rd_file = source.get_random_access_file().get()             # <<<<<<<<<<<<<<
 *     with nogil:
 *         check_status(ReadTensor(rd_file, &sp_tensor))
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_source->__pyx_vtab)->get_random_access_file(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 470, __pyx_L1_error)
  __pyx_v_rd_file = __pyx_t_1.get();

  /* "pyarrow/ipc.pxi":471
 * 
 *     rd_file = source.get_random_access_file().get()
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ReadTensor(rd_file, &sp_tensor))
 *     return pyarrow_wrap_tensor(sp_tensor)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":472
 *     rd_file = source.get_random_access_file().get()
 *     with nogil:
 *         check_status(ReadTensor(rd_file, &sp_tensor))             # <<<<<<<<<<<<<<
 *     return pyarrow_wrap_tensor(sp_tensor)
 * 
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(arrow::ipc::ReadTensor(__pyx_v_rd_file, (&__pyx_v_sp_tensor))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(7, 472, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":471
 * 
 *     rd_file = source.get_random_access_file().get()
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ReadTensor(rd_file, &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":473
 *     with nogil:
 *         check_status(ReadTensor(rd_file, &sp_tensor))
 *     return pyarrow_wrap_tensor(sp_tensor)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_tensor(__pyx_v_sp_tensor); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":451
 * 
 * 
 * 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_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":476
 * 
 * 
 * def read_message(source):             # <<<<<<<<<<<<<<
 *     """
 *     Read length-prefixed message from file or buffer-like object
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_147read_message(PyObject *__pyx_self, PyObject *__pyx_v_source); /*proto*/
static char __pyx_doc_7pyarrow_3lib_146read_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_147read_message = {"read_message", (PyCFunction)__pyx_pw_7pyarrow_3lib_147read_message, METH_O, __pyx_doc_7pyarrow_3lib_146read_message};
static PyObject *__pyx_pw_7pyarrow_3lib_147read_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_146read_message(__pyx_self, ((PyObject *)__pyx_v_source));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_146read_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;
  arrow::io::RandomAccessFile *__pyx_v_rd_file;
  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::shared_ptr<arrow::io::RandomAccessFile>  __pyx_t_6;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("read_message", 0);
  __Pyx_INCREF(__pyx_v_source);

  /* "pyarrow/ipc.pxi":489
 *     """
 *     cdef:
 *         Message result = Message.__new__(Message)             # <<<<<<<<<<<<<<
 *         NativeFile cpp_file
 *         RandomAccessFile* rd_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(7, 489, __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":493
 *         RandomAccessFile* rd_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":494
 * 
 *     if not isinstance(source, NativeFile):
 *         if hasattr(source, 'read'):             # <<<<<<<<<<<<<<
 *             source = PythonFile(source)
 *         else:
 */
    __pyx_t_3 = __Pyx_HasAttr(__pyx_v_source, __pyx_n_u_read); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 494, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (__pyx_t_2) {

      /* "pyarrow/ipc.pxi":495
 *     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(7, 495, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "pyarrow/ipc.pxi":494
 * 
 *     if not isinstance(source, NativeFile):
 *         if hasattr(source, 'read'):             # <<<<<<<<<<<<<<
 *             source = PythonFile(source)
 *         else:
 */
      goto __pyx_L4;
    }

    /* "pyarrow/ipc.pxi":497
 *             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(7, 497, __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":493
 *         RandomAccessFile* rd_file
 * 
 *     if not isinstance(source, NativeFile):             # <<<<<<<<<<<<<<
 *         if hasattr(source, 'read'):
 *             source = PythonFile(source)
 */
  }

  /* "pyarrow/ipc.pxi":499
 *             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":501
 *     if not isinstance(source, NativeFile):
 *         raise ValueError('Unable to read message from object with type: {0}'
 *                          .format(type(source)))             # <<<<<<<<<<<<<<
 * 
 *     cpp_file = source
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unable_to_read_message_from_obje, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 501, __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(7, 501, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/ipc.pxi":500
 * 
 *     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(7, 500, __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(7, 500, __pyx_L1_error)

    /* "pyarrow/ipc.pxi":499
 *             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":503
 *                          .format(type(source)))
 * 
 *     cpp_file = source             # <<<<<<<<<<<<<<
 *     rd_file = cpp_file.get_random_access_file().get()
 * 
 */
  if (!(likely(((__pyx_v_source) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile))))) __PYX_ERR(7, 503, __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":504
 * 
 *     cpp_file = source
 *     rd_file = cpp_file.get_random_access_file().get()             # <<<<<<<<<<<<<<
 * 
 *     with nogil:
 */
  __pyx_t_6 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_cpp_file->__pyx_vtab)->get_random_access_file(__pyx_v_cpp_file); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 504, __pyx_L1_error)
  __pyx_v_rd_file = __pyx_t_6.get();

  /* "pyarrow/ipc.pxi":506
 *     rd_file = cpp_file.get_random_access_file().get()
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ReadMessage(rd_file, &result.message))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":507
 * 
 *     with nogil:
 *         check_status(ReadMessage(rd_file, &result.message))             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_7 = __pyx_f_7pyarrow_3lib_check_status(arrow::ipc::ReadMessage(__pyx_v_rd_file, (&__pyx_v_result->message))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(7, 507, __pyx_L7_error)
      }

      /* "pyarrow/ipc.pxi":506
 *     rd_file = cpp_file.get_random_access_file().get()
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ReadMessage(rd_file, &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":509
 *         check_status(ReadMessage(rd_file, &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":476
 * 
 * 
 * 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":512
 * 
 * 
 * def read_schema(obj):             # <<<<<<<<<<<<<<
 *     """
 *     Read Schema from message or buffer
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_149read_schema(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_148read_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_149read_schema = {"read_schema", (PyCFunction)__pyx_pw_7pyarrow_3lib_149read_schema, METH_O, __pyx_doc_7pyarrow_3lib_148read_schema};
static PyObject *__pyx_pw_7pyarrow_3lib_149read_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_148read_schema(__pyx_self, ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_148read_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":528
 *         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":529
 * 
 *     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(7, 529, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(7, 529, __pyx_L1_error)

    /* "pyarrow/ipc.pxi":528
 *         shared_ptr[RandomAccessFile] cpp_file
 * 
 *     if isinstance(obj, Message):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError(type(obj))
 * 
 */
  }

  /* "pyarrow/ipc.pxi":531
 *         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(7, 531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/ipc.pxi":533
 *     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":534
 * 
 *     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(7, 534, __pyx_L5_error)
      }

      /* "pyarrow/ipc.pxi":533
 *     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":536
 *         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(7, 536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":512
 * 
 * 
 * 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":539
 * 
 * 
 * def read_record_batch(obj, Schema schema):             # <<<<<<<<<<<<<<
 *     """
 *     Read RecordBatch from message, given a known schema
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_151read_record_batch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_150read_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_151read_record_batch = {"read_record_batch", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_151read_record_batch, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_150read_record_batch};
static PyObject *__pyx_pw_7pyarrow_3lib_151read_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(7, 539, __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(7, 539, __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(7, 539, __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(7, 539, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_150read_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_150read_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":556
 *         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":557
 * 
 *     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(7, 557, __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":556
 *         Message message
 * 
 *     if isinstance(obj, Message):             # <<<<<<<<<<<<<<
 *         message = obj
 *     else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/ipc.pxi":559
 *         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(7, 559, __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(7, 559, __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(7, 559, __pyx_L1_error)
    __pyx_v_message = ((struct __pyx_obj_7pyarrow_3lib_Message *)__pyx_t_3);
    __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "pyarrow/ipc.pxi":561
 *         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":562
 * 
 *     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(7, 562, __pyx_L5_error)
      }

      /* "pyarrow/ipc.pxi":561
 *         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":565
 *                                      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(7, 565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":539
 * 
 * 
 * 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__214, 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__215, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__216, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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)             # <<<<<<<<<<<<<<
 * 
 *     def _read(self):
 */
  __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;
}

/* "pyarrow/feather.pxi":108
 *         return pyarrow_wrap_column(sp_column)
 * 
 *     def _read(self):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CTable] sp_table
 *         with nogil:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_9_read(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13FeatherReader_8_read[] = "FeatherReader._read(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_9_read(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_read (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherReader_8_read(((struct __pyx_obj_7pyarrow_3lib_FeatherReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_8_read(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self) {
  std::shared_ptr< arrow::Table>  __pyx_v_sp_table;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("_read", 0);

  /* "pyarrow/feather.pxi":110
 *     def _read(self):
 *         cdef shared_ptr[CTable] sp_table
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get()
 *                          .Read(&sp_table))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/feather.pxi":111
 *         cdef shared_ptr[CTable] sp_table
 *         with nogil:
 *             check_status(self.reader.get()             # <<<<<<<<<<<<<<
 *                          .Read(&sp_table))
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->reader.get()->Read((&__pyx_v_sp_table))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(13, 111, __pyx_L4_error)
      }

      /* "pyarrow/feather.pxi":110
 *     def _read(self):
 *         cdef shared_ptr[CTable] sp_table
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get()
 *                          .Read(&sp_table))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/feather.pxi":114
 *                          .Read(&sp_table))
 * 
 *         return pyarrow_wrap_table(sp_table)             # <<<<<<<<<<<<<<
 * 
 *     def _read_indices(self, indices):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_sp_table); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/feather.pxi":108
 *         return pyarrow_wrap_column(sp_column)
 * 
 *     def _read(self):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CTable] sp_table
 *         with nogil:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.FeatherReader._read", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/feather.pxi":116
 *         return pyarrow_wrap_table(sp_table)
 * 
 *     def _read_indices(self, indices):             # <<<<<<<<<<<<<<
 *         cdef:
 *             shared_ptr[CTable] sp_table
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_11_read_indices(PyObject *__pyx_v_self, PyObject *__pyx_v_indices); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13FeatherReader_10_read_indices[] = "FeatherReader._read_indices(self, indices)";
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_11_read_indices(PyObject *__pyx_v_self, PyObject *__pyx_v_indices) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_read_indices (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherReader_10_read_indices(((struct __pyx_obj_7pyarrow_3lib_FeatherReader *)__pyx_v_self), ((PyObject *)__pyx_v_indices));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_10_read_indices(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self, PyObject *__pyx_v_indices) {
  std::shared_ptr< arrow::Table>  __pyx_v_sp_table;
  std::vector<int>  __pyx_v_c_indices;
  PyObject *__pyx_v_index = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("_read_indices", 0);

  /* "pyarrow/feather.pxi":121
 *             vector[int] c_indices
 * 
 *         for index in indices:             # <<<<<<<<<<<<<<
 *             c_indices.push_back(index)
 *         with nogil:
 */
  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
    __pyx_t_1 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 121, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 121, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(13, 121, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 121, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(13, 121, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 121, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(13, 121, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/feather.pxi":122
 * 
 *         for index in indices:
 *             c_indices.push_back(index)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.reader.get()
 */
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_index); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(13, 122, __pyx_L1_error)
    try {
      __pyx_v_c_indices.push_back(__pyx_t_5);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(13, 122, __pyx_L1_error)
    }

    /* "pyarrow/feather.pxi":121
 *             vector[int] c_indices
 * 
 *         for index in indices:             # <<<<<<<<<<<<<<
 *             c_indices.push_back(index)
 *         with nogil:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/feather.pxi":123
 *         for index in indices:
 *             c_indices.push_back(index)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get()
 *                          .Read(c_indices, &sp_table))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/feather.pxi":124
 *             c_indices.push_back(index)
 *         with nogil:
 *             check_status(self.reader.get()             # <<<<<<<<<<<<<<
 *                          .Read(c_indices, &sp_table))
 * 
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->reader.get()->Read(__pyx_v_c_indices, (&__pyx_v_sp_table))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(13, 124, __pyx_L6_error)
      }

      /* "pyarrow/feather.pxi":123
 *         for index in indices:
 *             c_indices.push_back(index)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get()
 *                          .Read(c_indices, &sp_table))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L6_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/feather.pxi":127
 *                          .Read(c_indices, &sp_table))
 * 
 *         return pyarrow_wrap_table(sp_table)             # <<<<<<<<<<<<<<
 * 
 *     def _read_names(self, names):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_sp_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/feather.pxi":116
 *         return pyarrow_wrap_table(sp_table)
 * 
 *     def _read_indices(self, indices):             # <<<<<<<<<<<<<<
 *         cdef:
 *             shared_ptr[CTable] sp_table
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.FeatherReader._read_indices", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/feather.pxi":129
 *         return pyarrow_wrap_table(sp_table)
 * 
 *     def _read_names(self, names):             # <<<<<<<<<<<<<<
 *         cdef:
 *             shared_ptr[CTable] sp_table
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_13_read_names(PyObject *__pyx_v_self, PyObject *__pyx_v_names); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13FeatherReader_12_read_names[] = "FeatherReader._read_names(self, names)";
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_13_read_names(PyObject *__pyx_v_self, PyObject *__pyx_v_names) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_read_names (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherReader_12_read_names(((struct __pyx_obj_7pyarrow_3lib_FeatherReader *)__pyx_v_self), ((PyObject *)__pyx_v_names));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_12_read_names(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self, PyObject *__pyx_v_names) {
  std::shared_ptr< arrow::Table>  __pyx_v_sp_table;
  std::vector<std::string>  __pyx_v_c_names;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  std::string __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("_read_names", 0);

  /* "pyarrow/feather.pxi":134
 *             vector[c_string] c_names
 * 
 *         for name in names:             # <<<<<<<<<<<<<<
 *             c_names.push_back(tobytes(name))
 *         with nogil:
 */
  if (likely(PyList_CheckExact(__pyx_v_names)) || PyTuple_CheckExact(__pyx_v_names)) {
    __pyx_t_1 = __pyx_v_names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_names); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 134, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 134, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(13, 134, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 134, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(13, 134, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 134, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(13, 134, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/feather.pxi":135
 * 
 *         for name in names:
 *             c_names.push_back(tobytes(name))             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.reader.get()
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_name);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __pyx_convert_string_from_py_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(13, 135, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    try {
      __pyx_v_c_names.push_back(__pyx_t_7);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(13, 135, __pyx_L1_error)
    }

    /* "pyarrow/feather.pxi":134
 *             vector[c_string] c_names
 * 
 *         for name in names:             # <<<<<<<<<<<<<<
 *             c_names.push_back(tobytes(name))
 *         with nogil:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/feather.pxi":136
 *         for name in names:
 *             c_names.push_back(tobytes(name))
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get()
 *                          .Read(c_names, &sp_table))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/feather.pxi":137
 *             c_names.push_back(tobytes(name))
 *         with nogil:
 *             check_status(self.reader.get()             # <<<<<<<<<<<<<<
 *                          .Read(c_names, &sp_table))
 * 
 */
        __pyx_t_8 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->reader.get()->Read(__pyx_v_c_names, (&__pyx_v_sp_table))); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(13, 137, __pyx_L6_error)
      }

      /* "pyarrow/feather.pxi":136
 *         for name in names:
 *             c_names.push_back(tobytes(name))
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get()
 *                          .Read(c_names, &sp_table))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L6_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/feather.pxi":140
 *                          .Read(c_names, &sp_table))
 * 
 *         return pyarrow_wrap_table(sp_table)             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_sp_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/feather.pxi":129
 *         return pyarrow_wrap_table(sp_table)
 * 
 *     def _read_names(self, names):             # <<<<<<<<<<<<<<
 *         cdef:
 *             shared_ptr[CTable] sp_table
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.FeatherReader._read_names", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_15__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13FeatherReader_14__reduce_cython__[] = "FeatherReader.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_15__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherReader_14__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_FeatherReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_14__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__217, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FeatherReader.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_17__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13FeatherReader_16__setstate_cython__[] = "FeatherReader.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_17__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherReader_16__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_FeatherReader *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_16__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__218, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FeatherReader.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":25
 * 
 * 
 * def is_named_tuple(cls):             # <<<<<<<<<<<<<<
 *     """Return True if cls is a namedtuple and False otherwise."""
 *     b = cls.__bases__
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_153is_named_tuple(PyObject *__pyx_self, PyObject *__pyx_v_cls); /*proto*/
static char __pyx_doc_7pyarrow_3lib_152is_named_tuple[] = "is_named_tuple(cls)\nReturn True if cls is a namedtuple and False otherwise.";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_153is_named_tuple = {"is_named_tuple", (PyCFunction)__pyx_pw_7pyarrow_3lib_153is_named_tuple, METH_O, __pyx_doc_7pyarrow_3lib_152is_named_tuple};
static PyObject *__pyx_pw_7pyarrow_3lib_153is_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_152is_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":33
 *     if not isinstance(f, tuple):
 *         return False
 *     return all(isinstance(n, six.string_types) for n in f)             # <<<<<<<<<<<<<<
 * 
 * 
 */

static PyObject *__pyx_pf_7pyarrow_3lib_14is_named_tuple_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_genexpr *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_14_genexpr(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_14_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(14, 33, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13_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, 33, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.is_named_tuple.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7pyarrow_3lib_14is_named_tuple_2generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(14, 33, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_f)) { __Pyx_RaiseClosureNameError("f"); __PYX_ERR(14, 33, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_f)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_f)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_f; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_f); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 33, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(14, 33, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 33, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(14, 33, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 33, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(14, 33, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_n);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_n, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_six); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_string_types); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = PyObject_IsInstance(__pyx_cur_scope->__pyx_v_n, __pyx_t_5); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(14, 33, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = ((!(__pyx_t_6 != 0)) != 0);
    if (__pyx_t_7) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":25
 * 
 * 
 * def is_named_tuple(cls):             # <<<<<<<<<<<<<<
 *     """Return True if cls is a namedtuple and False otherwise."""
 *     b = cls.__bases__
 */

static PyObject *__pyx_pf_7pyarrow_3lib_152is_named_tuple(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13_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_13_is_named_tuple *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_13_is_named_tuple(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_13_is_named_tuple, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13_is_named_tuple *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(14, 25, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }

  /* "pyarrow/serialization.pxi":27
 * def is_named_tuple(cls):
 *     """Return True if cls is a namedtuple and False otherwise."""
 *     b = cls.__bases__             # <<<<<<<<<<<<<<
 *     if len(b) != 1 or b[0] != tuple:
 *         return False
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_bases); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_b = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":28
 *     """Return True if cls is a namedtuple and False otherwise."""
 *     b = cls.__bases__
 *     if len(b) != 1 or b[0] != tuple:             # <<<<<<<<<<<<<<
 *         return False
 *     f = getattr(cls, "_fields", None)
 */
  __pyx_t_3 = PyObject_Length(__pyx_v_b); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(14, 28, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 != 1) != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_b, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, ((PyObject *)(&PyTuple_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(14, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pyarrow/serialization.pxi":29
 *     b = cls.__bases__
 *     if len(b) != 1 or b[0] != tuple:
 *         return False             # <<<<<<<<<<<<<<
 *     f = getattr(cls, "_fields", None)
 *     if not isinstance(f, tuple):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "pyarrow/serialization.pxi":28
 *     """Return True if cls is a namedtuple and False otherwise."""
 *     b = cls.__bases__
 *     if len(b) != 1 or b[0] != tuple:             # <<<<<<<<<<<<<<
 *         return False
 *     f = getattr(cls, "_fields", None)
 */
  }

  /* "pyarrow/serialization.pxi":30
 *     if len(b) != 1 or b[0] != tuple:
 *         return False
 *     f = getattr(cls, "_fields", None)             # <<<<<<<<<<<<<<
 *     if not isinstance(f, tuple):
 *         return False
 */
  __pyx_t_5 = __Pyx_GetAttr3(__pyx_v_cls, __pyx_n_u_fields_2, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_cur_scope->__pyx_v_f = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "pyarrow/serialization.pxi":31
 *         return False
 *     f = getattr(cls, "_fields", None)
 *     if not isinstance(f, tuple):             # <<<<<<<<<<<<<<
 *         return False
 *     return all(isinstance(n, six.string_types) for n in f)
 */
  __pyx_t_5 = __pyx_cur_scope->__pyx_v_f;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_2 = PyTuple_Check(__pyx_t_5); 
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
  if (__pyx_t_4) {

    /* "pyarrow/serialization.pxi":32
 *     f = getattr(cls, "_fields", None)
 *     if not isinstance(f, tuple):
 *         return False             # <<<<<<<<<<<<<<
 *     return all(isinstance(n, six.string_types) for n in f)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "pyarrow/serialization.pxi":31
 *         return False
 *     f = getattr(cls, "_fields", None)
 *     if not isinstance(f, tuple):             # <<<<<<<<<<<<<<
 *         return False
 *     return all(isinstance(n, six.string_types) for n in f)
 */
  }

  /* "pyarrow/serialization.pxi":33
 *     if not isinstance(f, tuple):
 *         return False
 *     return all(isinstance(n, six.string_types) for n in f)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __pyx_pf_7pyarrow_3lib_14is_named_tuple_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":25
 * 
 * 
 * def is_named_tuple(cls):             # <<<<<<<<<<<<<<
 *     """Return True if cls is a namedtuple and False otherwise."""
 *     b = cls.__bases__
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.is_named_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_b);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":37
 * 
 * class SerializationCallbackError(ArrowSerializationError):
 *     def __init__(self, message, example_object):             # <<<<<<<<<<<<<<
 *         ArrowSerializationError.__init__(self, message)
 *         self.example_object = example_object
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_26SerializationCallbackError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_26SerializationCallbackError___init__[] = "SerializationCallbackError.__init__(self, message, example_object)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_26SerializationCallbackError_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_26SerializationCallbackError_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_26SerializationCallbackError___init__};
static PyObject *__pyx_pw_7pyarrow_3lib_26SerializationCallbackError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_message = 0;
  PyObject *__pyx_v_example_object = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_message,&__pyx_n_s_example_object,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(14, 37, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_example_object)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(14, 37, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(14, 37, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_message = values[1];
    __pyx_v_example_object = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(14, 37, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.SerializationCallbackError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_26SerializationCallbackError___init__(__pyx_self, __pyx_v_self, __pyx_v_message, __pyx_v_example_object);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_26SerializationCallbackError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_example_object) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/serialization.pxi":38
 * class SerializationCallbackError(ArrowSerializationError):
 *     def __init__(self, message, example_object):
 *         ArrowSerializationError.__init__(self, message)             # <<<<<<<<<<<<<<
 *         self.example_object = example_object
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ArrowSerializationError); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_self, __pyx_v_message};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 38, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_self, __pyx_v_message};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 38, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 38, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
    __Pyx_INCREF(__pyx_v_message);
    __Pyx_GIVEREF(__pyx_v_message);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_message);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 38, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":39
 *     def __init__(self, message, example_object):
 *         ArrowSerializationError.__init__(self, message)
 *         self.example_object = example_object             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_example_object, __pyx_v_example_object) < 0) __PYX_ERR(14, 39, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":37
 * 
 * class SerializationCallbackError(ArrowSerializationError):
 *     def __init__(self, message, example_object):             # <<<<<<<<<<<<<<
 *         ArrowSerializationError.__init__(self, message)
 *         self.example_object = example_object
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.SerializationCallbackError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":43
 * 
 * class DeserializationCallbackError(ArrowSerializationError):
 *     def __init__(self, message, type_id):             # <<<<<<<<<<<<<<
 *         ArrowSerializationError.__init__(self, message)
 *         self.type_id = type_id
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_28DeserializationCallbackError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_28DeserializationCallbackError___init__[] = "DeserializationCallbackError.__init__(self, message, type_id)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_28DeserializationCallbackError_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_28DeserializationCallbackError_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_28DeserializationCallbackError___init__};
static PyObject *__pyx_pw_7pyarrow_3lib_28DeserializationCallbackError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_message = 0;
  PyObject *__pyx_v_type_id = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_message,&__pyx_n_s_type_id,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(14, 43, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type_id)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(14, 43, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(14, 43, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_message = values[1];
    __pyx_v_type_id = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(14, 43, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.DeserializationCallbackError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_28DeserializationCallbackError___init__(__pyx_self, __pyx_v_self, __pyx_v_message, __pyx_v_type_id);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_28DeserializationCallbackError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_type_id) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/serialization.pxi":44
 * class DeserializationCallbackError(ArrowSerializationError):
 *     def __init__(self, message, type_id):
 *         ArrowSerializationError.__init__(self, message)             # <<<<<<<<<<<<<<
 *         self.type_id = type_id
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ArrowSerializationError); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_self, __pyx_v_message};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 44, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_self, __pyx_v_message};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 44, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 44, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
    __Pyx_INCREF(__pyx_v_message);
    __Pyx_GIVEREF(__pyx_v_message);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_message);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 44, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":45
 *     def __init__(self, message, type_id):
 *         ArrowSerializationError.__init__(self, message)
 *         self.type_id = type_id             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_type_id, __pyx_v_type_id) < 0) __PYX_ERR(14, 45, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":43
 * 
 * class DeserializationCallbackError(ArrowSerializationError):
 *     def __init__(self, message, type_id):             # <<<<<<<<<<<<<<
 *         ArrowSerializationError.__init__(self, message)
 *         self.type_id = type_id
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.DeserializationCallbackError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":58
 *         object pickle_deserializer
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         # Types with special serialization handlers
 *         self.type_to_type_id = dict()
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_20SerializationContext_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_20SerializationContext_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_20SerializationContext___init__(((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_20SerializationContext___init__(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/serialization.pxi":60
 *     def __init__(self):
 *         # Types with special serialization handlers
 *         self.type_to_type_id = dict()             # <<<<<<<<<<<<<<
 *         self.whitelisted_types = dict()
 *         self.types_to_pickle = set()
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->type_to_type_id);
  __Pyx_DECREF(__pyx_v_self->type_to_type_id);
  __pyx_v_self->type_to_type_id = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":61
 *         # Types with special serialization handlers
 *         self.type_to_type_id = dict()
 *         self.whitelisted_types = dict()             # <<<<<<<<<<<<<<
 *         self.types_to_pickle = set()
 *         self.custom_serializers = dict()
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->whitelisted_types);
  __Pyx_DECREF(__pyx_v_self->whitelisted_types);
  __pyx_v_self->whitelisted_types = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":62
 *         self.type_to_type_id = dict()
 *         self.whitelisted_types = dict()
 *         self.types_to_pickle = set()             # <<<<<<<<<<<<<<
 *         self.custom_serializers = dict()
 *         self.custom_deserializers = dict()
 */
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->types_to_pickle);
  __Pyx_DECREF(__pyx_v_self->types_to_pickle);
  __pyx_v_self->types_to_pickle = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":63
 *         self.whitelisted_types = dict()
 *         self.types_to_pickle = set()
 *         self.custom_serializers = dict()             # <<<<<<<<<<<<<<
 *         self.custom_deserializers = dict()
 *         self.pickle_serializer = pickle.dumps
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->custom_serializers);
  __Pyx_DECREF(__pyx_v_self->custom_serializers);
  __pyx_v_self->custom_serializers = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":64
 *         self.types_to_pickle = set()
 *         self.custom_serializers = dict()
 *         self.custom_deserializers = dict()             # <<<<<<<<<<<<<<
 *         self.pickle_serializer = pickle.dumps
 *         self.pickle_deserializer = pickle.loads
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->custom_deserializers);
  __Pyx_DECREF(__pyx_v_self->custom_deserializers);
  __pyx_v_self->custom_deserializers = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":65
 *         self.custom_serializers = dict()
 *         self.custom_deserializers = dict()
 *         self.pickle_serializer = pickle.dumps             # <<<<<<<<<<<<<<
 *         self.pickle_deserializer = pickle.loads
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pickle); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dumps); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->pickle_serializer);
  __Pyx_DECREF(__pyx_v_self->pickle_serializer);
  __pyx_v_self->pickle_serializer = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/serialization.pxi":66
 *         self.custom_deserializers = dict()
 *         self.pickle_serializer = pickle.dumps
 *         self.pickle_deserializer = pickle.loads             # <<<<<<<<<<<<<<
 * 
 *     def set_pickle(self, serializer, deserializer):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pickle); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_loads); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->pickle_deserializer);
  __Pyx_DECREF(__pyx_v_self->pickle_deserializer);
  __pyx_v_self->pickle_deserializer = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":58
 *         object pickle_deserializer
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         # Types with special serialization handlers
 *         self.type_to_type_id = dict()
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.SerializationContext.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":68
 *         self.pickle_deserializer = pickle.loads
 * 
 *     def set_pickle(self, serializer, deserializer):             # <<<<<<<<<<<<<<
 *         """
 *         Set the serializer and deserializer to use for objects that are to be
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_3set_pickle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20SerializationContext_2set_pickle[] = "SerializationContext.set_pickle(self, serializer, deserializer)\n\n        Set the serializer and deserializer to use for objects that are to be\n        pickled.\n\n        Parameters\n        ----------\n        serializer : callable\n            The serializer to use (e.g., pickle.dumps or cloudpickle.dumps).\n        deserializer : callable\n            The deserializer to use (e.g., pickle.dumps or cloudpickle.dumps).\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_3set_pickle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_serializer = 0;
  PyObject *__pyx_v_deserializer = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_pickle (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_serializer,&__pyx_n_s_deserializer,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_serializer)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_deserializer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_pickle", 1, 2, 2, 1); __PYX_ERR(14, 68, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_pickle") < 0)) __PYX_ERR(14, 68, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_serializer = values[0];
    __pyx_v_deserializer = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_pickle", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(14, 68, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.SerializationContext.set_pickle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_20SerializationContext_2set_pickle(((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_v_self), __pyx_v_serializer, __pyx_v_deserializer);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_2set_pickle(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_serializer, PyObject *__pyx_v_deserializer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_pickle", 0);

  /* "pyarrow/serialization.pxi":80
 *             The deserializer to use (e.g., pickle.dumps or cloudpickle.dumps).
 *         """
 *         self.pickle_serializer = serializer             # <<<<<<<<<<<<<<
 *         self.pickle_deserializer = deserializer
 * 
 */
  __Pyx_INCREF(__pyx_v_serializer);
  __Pyx_GIVEREF(__pyx_v_serializer);
  __Pyx_GOTREF(__pyx_v_self->pickle_serializer);
  __Pyx_DECREF(__pyx_v_self->pickle_serializer);
  __pyx_v_self->pickle_serializer = __pyx_v_serializer;

  /* "pyarrow/serialization.pxi":81
 *         """
 *         self.pickle_serializer = serializer
 *         self.pickle_deserializer = deserializer             # <<<<<<<<<<<<<<
 * 
 *     def clone(self):
 */
  __Pyx_INCREF(__pyx_v_deserializer);
  __Pyx_GIVEREF(__pyx_v_deserializer);
  __Pyx_GOTREF(__pyx_v_self->pickle_deserializer);
  __Pyx_DECREF(__pyx_v_self->pickle_deserializer);
  __pyx_v_self->pickle_deserializer = __pyx_v_deserializer;

  /* "pyarrow/serialization.pxi":68
 *         self.pickle_deserializer = pickle.loads
 * 
 *     def set_pickle(self, serializer, deserializer):             # <<<<<<<<<<<<<<
 *         """
 *         Set the serializer and deserializer to use for objects that are to be
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":83
 *         self.pickle_deserializer = deserializer
 * 
 *     def clone(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return copy of this SerializationContext
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_5clone(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20SerializationContext_4clone[] = "SerializationContext.clone(self)\n\n        Return copy of this SerializationContext\n\n        Returns\n        -------\n        clone : SerializationContext\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_5clone(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clone (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20SerializationContext_4clone(((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_4clone(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("clone", 0);

  /* "pyarrow/serialization.pxi":91
 *         clone : SerializationContext
 *         """
 *         result = SerializationContext()             # <<<<<<<<<<<<<<
 *         result.type_to_type_id = self.type_to_type_id.copy()
 *         result.whitelisted_types = self.whitelisted_types.copy()
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_SerializationContext)); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":92
 *         """
 *         result = SerializationContext()
 *         result.type_to_type_id = self.type_to_type_id.copy()             # <<<<<<<<<<<<<<
 *         result.whitelisted_types = self.whitelisted_types.copy()
 *         result.types_to_pickle = self.types_to_pickle.copy()
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->type_to_type_id, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(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->type_to_type_id);
  __Pyx_DECREF(__pyx_v_result->type_to_type_id);
  __pyx_v_result->type_to_type_id = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":93
 *         result = SerializationContext()
 *         result.type_to_type_id = self.type_to_type_id.copy()
 *         result.whitelisted_types = self.whitelisted_types.copy()             # <<<<<<<<<<<<<<
 *         result.types_to_pickle = self.types_to_pickle.copy()
 *         result.custom_serializers = self.custom_serializers.copy()
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->whitelisted_types, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(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->whitelisted_types);
  __Pyx_DECREF(__pyx_v_result->whitelisted_types);
  __pyx_v_result->whitelisted_types = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":94
 *         result.type_to_type_id = self.type_to_type_id.copy()
 *         result.whitelisted_types = self.whitelisted_types.copy()
 *         result.types_to_pickle = self.types_to_pickle.copy()             # <<<<<<<<<<<<<<
 *         result.custom_serializers = self.custom_serializers.copy()
 *         result.custom_deserializers = self.custom_deserializers.copy()
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->types_to_pickle, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(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->types_to_pickle);
  __Pyx_DECREF(__pyx_v_result->types_to_pickle);
  __pyx_v_result->types_to_pickle = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":95
 *         result.whitelisted_types = self.whitelisted_types.copy()
 *         result.types_to_pickle = self.types_to_pickle.copy()
 *         result.custom_serializers = self.custom_serializers.copy()             # <<<<<<<<<<<<<<
 *         result.custom_deserializers = self.custom_deserializers.copy()
 *         result.pickle_serializer = self.pickle_serializer
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->custom_serializers, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 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(14, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_result->custom_serializers);
  __Pyx_DECREF(__pyx_v_result->custom_serializers);
  __pyx_v_result->custom_serializers = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":96
 *         result.types_to_pickle = self.types_to_pickle.copy()
 *         result.custom_serializers = self.custom_serializers.copy()
 *         result.custom_deserializers = self.custom_deserializers.copy()             # <<<<<<<<<<<<<<
 *         result.pickle_serializer = self.pickle_serializer
 *         result.pickle_deserializer = self.pickle_deserializer
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->custom_deserializers, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_result->custom_deserializers);
  __Pyx_DECREF(__pyx_v_result->custom_deserializers);
  __pyx_v_result->custom_deserializers = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":97
 *         result.custom_serializers = self.custom_serializers.copy()
 *         result.custom_deserializers = self.custom_deserializers.copy()
 *         result.pickle_serializer = self.pickle_serializer             # <<<<<<<<<<<<<<
 *         result.pickle_deserializer = self.pickle_deserializer
 * 
 */
  __pyx_t_1 = __pyx_v_self->pickle_serializer;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_result->pickle_serializer);
  __Pyx_DECREF(__pyx_v_result->pickle_serializer);
  __pyx_v_result->pickle_serializer = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":98
 *         result.custom_deserializers = self.custom_deserializers.copy()
 *         result.pickle_serializer = self.pickle_serializer
 *         result.pickle_deserializer = self.pickle_deserializer             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  __pyx_t_1 = __pyx_v_self->pickle_deserializer;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_result->pickle_deserializer);
  __Pyx_DECREF(__pyx_v_result->pickle_deserializer);
  __pyx_v_result->pickle_deserializer = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":100
 *         result.pickle_deserializer = self.pickle_deserializer
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def register_type(self, type_, type_id, pickle=False,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":83
 *         self.pickle_deserializer = deserializer
 * 
 *     def clone(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return copy of this SerializationContext
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.SerializationContext.clone", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":102
 *         return result
 * 
 *     def register_type(self, type_, type_id, pickle=False,             # <<<<<<<<<<<<<<
 *                       custom_serializer=None, custom_deserializer=None):
 *         """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_3,&__pyx_n_s_type_id,&__pyx_n_s_pickle,&__pyx_n_s_custom_serializer,&__pyx_n_s_custom_deserializer,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[2] = ((PyObject *)Py_False);

    /* "pyarrow/serialization.pxi":103
 * 
 *     def register_type(self, type_, type_id, pickle=False,
 *                       custom_serializer=None, custom_deserializer=None):             # <<<<<<<<<<<<<<
 *         """EXPERIMENTAL: Add type to the list of types we can serialize.
 * 
 */
    values[3] = ((PyObject *)Py_None);
    values[4] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type_3)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type_id)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("register_type", 0, 2, 5, 1); __PYX_ERR(14, 102, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pickle);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_custom_serializer);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_custom_deserializer);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "register_type") < 0)) __PYX_ERR(14, 102, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_type_ = values[0];
    __pyx_v_type_id = values[1];
    __pyx_v_pickle = values[2];
    __pyx_v_custom_serializer = values[3];
    __pyx_v_custom_deserializer = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("register_type", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(14, 102, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.SerializationContext.register_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_20SerializationContext_6register_type(((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_v_self), __pyx_v_type_, __pyx_v_type_id, __pyx_v_pickle, __pyx_v_custom_serializer, __pyx_v_custom_deserializer);

  /* "pyarrow/serialization.pxi":102
 *         return result
 * 
 *     def register_type(self, type_, type_id, pickle=False,             # <<<<<<<<<<<<<<
 *                       custom_serializer=None, custom_deserializer=None):
 *         """EXPERIMENTAL: Add type to the list of types we can serialize.
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_6register_type(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_type_, PyObject *__pyx_v_type_id, PyObject *__pyx_v_pickle, PyObject *__pyx_v_custom_serializer, PyObject *__pyx_v_custom_deserializer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("register_type", 0);

  /* "pyarrow/serialization.pxi":122
 *             deserialize objects of the class in a particular way.
 *         """
 *         if not isinstance(type_id, six.string_types):             # <<<<<<<<<<<<<<
 *             raise TypeError("The type_id argument must be a string. The value "
 *                             "passed in has type {}.".format(type(type_id)))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_six); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_string_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_type_id, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(14, 122, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "pyarrow/serialization.pxi":124
 *         if not isinstance(type_id, six.string_types):
 *             raise TypeError("The type_id argument must be a string. The value "
 *                             "passed in has type {}.".format(type(type_id)))             # <<<<<<<<<<<<<<
 * 
 *         self.type_to_type_id[type_] = type_id
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_The_type_id_argument_must_be_a_s, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 124, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, ((PyObject *)Py_TYPE(__pyx_v_type_id))) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)Py_TYPE(__pyx_v_type_id)));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 124, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/serialization.pxi":123
 *         """
 *         if not isinstance(type_id, six.string_types):
 *             raise TypeError("The type_id argument must be a string. The value "             # <<<<<<<<<<<<<<
 *                             "passed in has type {}.".format(type(type_id)))
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 123, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(14, 123, __pyx_L1_error)

    /* "pyarrow/serialization.pxi":122
 *             deserialize objects of the class in a particular way.
 *         """
 *         if not isinstance(type_id, six.string_types):             # <<<<<<<<<<<<<<
 *             raise TypeError("The type_id argument must be a string. The value "
 *                             "passed in has type {}.".format(type(type_id)))
 */
  }

  /* "pyarrow/serialization.pxi":126
 *                             "passed in has type {}.".format(type(type_id)))
 * 
 *         self.type_to_type_id[type_] = type_id             # <<<<<<<<<<<<<<
 *         self.whitelisted_types[type_id] = type_
 *         if pickle:
 */
  if (unlikely(PyObject_SetItem(__pyx_v_self->type_to_type_id, __pyx_v_type_, __pyx_v_type_id) < 0)) __PYX_ERR(14, 126, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":127
 * 
 *         self.type_to_type_id[type_] = type_id
 *         self.whitelisted_types[type_id] = type_             # <<<<<<<<<<<<<<
 *         if pickle:
 *             self.types_to_pickle.add(type_id)
 */
  if (unlikely(PyObject_SetItem(__pyx_v_self->whitelisted_types, __pyx_v_type_id, __pyx_v_type_) < 0)) __PYX_ERR(14, 127, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":128
 *         self.type_to_type_id[type_] = type_id
 *         self.whitelisted_types[type_id] = type_
 *         if pickle:             # <<<<<<<<<<<<<<
 *             self.types_to_pickle.add(type_id)
 *         if custom_serializer is not None:
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_pickle); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(14, 128, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "pyarrow/serialization.pxi":129
 *         self.whitelisted_types[type_id] = type_
 *         if pickle:
 *             self.types_to_pickle.add(type_id)             # <<<<<<<<<<<<<<
 *         if custom_serializer is not None:
 *             self.custom_serializers[type_id] = custom_serializer
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->types_to_pickle, __pyx_n_s_add); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 129, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_v_type_id) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_type_id);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 129, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/serialization.pxi":128
 *         self.type_to_type_id[type_] = type_id
 *         self.whitelisted_types[type_id] = type_
 *         if pickle:             # <<<<<<<<<<<<<<
 *             self.types_to_pickle.add(type_id)
 *         if custom_serializer is not None:
 */
  }

  /* "pyarrow/serialization.pxi":130
 *         if pickle:
 *             self.types_to_pickle.add(type_id)
 *         if custom_serializer is not None:             # <<<<<<<<<<<<<<
 *             self.custom_serializers[type_id] = custom_serializer
 *             self.custom_deserializers[type_id] = custom_deserializer
 */
  __pyx_t_4 = (__pyx_v_custom_serializer != Py_None);
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/serialization.pxi":131
 *             self.types_to_pickle.add(type_id)
 *         if custom_serializer is not None:
 *             self.custom_serializers[type_id] = custom_serializer             # <<<<<<<<<<<<<<
 *             self.custom_deserializers[type_id] = custom_deserializer
 * 
 */
    if (unlikely(PyObject_SetItem(__pyx_v_self->custom_serializers, __pyx_v_type_id, __pyx_v_custom_serializer) < 0)) __PYX_ERR(14, 131, __pyx_L1_error)

    /* "pyarrow/serialization.pxi":132
 *         if custom_serializer is not None:
 *             self.custom_serializers[type_id] = custom_serializer
 *             self.custom_deserializers[type_id] = custom_deserializer             # <<<<<<<<<<<<<<
 * 
 *     def _serialize_callback(self, obj):
 */
    if (unlikely(PyObject_SetItem(__pyx_v_self->custom_deserializers, __pyx_v_type_id, __pyx_v_custom_deserializer) < 0)) __PYX_ERR(14, 132, __pyx_L1_error)

    /* "pyarrow/serialization.pxi":130
 *         if pickle:
 *             self.types_to_pickle.add(type_id)
 *         if custom_serializer is not None:             # <<<<<<<<<<<<<<
 *             self.custom_serializers[type_id] = custom_serializer
 *             self.custom_deserializers[type_id] = custom_deserializer
 */
  }

  /* "pyarrow/serialization.pxi":102
 *         return result
 * 
 *     def register_type(self, type_, type_id, pickle=False,             # <<<<<<<<<<<<<<
 *                       custom_serializer=None, custom_deserializer=None):
 *         """EXPERIMENTAL: Add type to the list of types we can serialize.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.SerializationContext.register_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":134
 *             self.custom_deserializers[type_id] = custom_deserializer
 * 
 *     def _serialize_callback(self, obj):             # <<<<<<<<<<<<<<
 *         found = False
 *         for type_ in type(obj).__mro__:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_9_serialize_callback(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20SerializationContext_8_serialize_callback[] = "SerializationContext._serialize_callback(self, obj)";
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_9_serialize_callback(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_serialize_callback (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20SerializationContext_8_serialize_callback(((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_8_serialize_callback(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_obj) {
  int __pyx_v_found;
  PyObject *__pyx_v_type_ = NULL;
  PyObject *__pyx_v_type_id = NULL;
  PyObject *__pyx_v_serialized_obj = NULL;
  PyObject *__pyx_v_msg = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("_serialize_callback", 0);

  /* "pyarrow/serialization.pxi":135
 * 
 *     def _serialize_callback(self, obj):
 *         found = False             # <<<<<<<<<<<<<<
 *         for type_ in type(obj).__mro__:
 *             if type_ in self.type_to_type_id:
 */
  __pyx_v_found = 0;

  /* "pyarrow/serialization.pxi":136
 *     def _serialize_callback(self, obj):
 *         found = False
 *         for type_ in type(obj).__mro__:             # <<<<<<<<<<<<<<
 *             if type_ in self.type_to_type_id:
 *                 found = True
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_n_s_mro); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 136, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(14, 136, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 136, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(14, 136, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 136, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(14, 136, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_type_, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/serialization.pxi":137
 *         found = False
 *         for type_ in type(obj).__mro__:
 *             if type_ in self.type_to_type_id:             # <<<<<<<<<<<<<<
 *                 found = True
 *                 break
 */
    __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_type_, __pyx_v_self->type_to_type_id, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(14, 137, __pyx_L1_error)
    __pyx_t_6 = (__pyx_t_5 != 0);
    if (__pyx_t_6) {

      /* "pyarrow/serialization.pxi":138
 *         for type_ in type(obj).__mro__:
 *             if type_ in self.type_to_type_id:
 *                 found = True             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
      __pyx_v_found = 1;

      /* "pyarrow/serialization.pxi":139
 *             if type_ in self.type_to_type_id:
 *                 found = True
 *                 break             # <<<<<<<<<<<<<<
 * 
 *         if not found:
 */
      goto __pyx_L4_break;

      /* "pyarrow/serialization.pxi":137
 *         found = False
 *         for type_ in type(obj).__mro__:
 *             if type_ in self.type_to_type_id:             # <<<<<<<<<<<<<<
 *                 found = True
 *                 break
 */
    }

    /* "pyarrow/serialization.pxi":136
 *     def _serialize_callback(self, obj):
 *         found = False
 *         for type_ in type(obj).__mro__:             # <<<<<<<<<<<<<<
 *             if type_ in self.type_to_type_id:
 *                 found = True
 */
  }
  __pyx_L4_break:;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/serialization.pxi":141
 *                 break
 * 
 *         if not found:             # <<<<<<<<<<<<<<
 *             raise SerializationCallbackError(
 *                 "pyarrow does not know how to "
 */
  __pyx_t_6 = ((!(__pyx_v_found != 0)) != 0);
  if (unlikely(__pyx_t_6)) {

    /* "pyarrow/serialization.pxi":142
 * 
 *         if not found:
 *             raise SerializationCallbackError(             # <<<<<<<<<<<<<<
 *                 "pyarrow does not know how to "
 *                 "serialize objects of type {}.".format(type(obj)), obj
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SerializationCallbackError); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "pyarrow/serialization.pxi":144
 *             raise SerializationCallbackError(
 *                 "pyarrow does not know how to "
 *                 "serialize objects of type {}.".format(type(obj)), obj             # <<<<<<<<<<<<<<
 *             )
 * 
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_pyarrow_does_not_know_how_to_ser, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) __PYX_ERR(14, 144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_7 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, ((PyObject *)Py_TYPE(__pyx_v_obj))) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)Py_TYPE(__pyx_v_obj)));
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    __pyx_t_10 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_10 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_7, __pyx_v_obj};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 142, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_7, __pyx_v_obj};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 142, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(14, 142, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_8) {
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_10, __pyx_t_7);
      __Pyx_INCREF(__pyx_v_obj);
      __Pyx_GIVEREF(__pyx_v_obj);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_10, __pyx_v_obj);
      __pyx_t_7 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 142, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(14, 142, __pyx_L1_error)

    /* "pyarrow/serialization.pxi":141
 *                 break
 * 
 *         if not found:             # <<<<<<<<<<<<<<
 *             raise SerializationCallbackError(
 *                 "pyarrow does not know how to "
 */
  }

  /* "pyarrow/serialization.pxi":148
 * 
 *         # use the closest match to type(obj)
 *         type_id = self.type_to_type_id[type_]             # <<<<<<<<<<<<<<
 *         if type_id in self.types_to_pickle:
 *             serialized_obj = {"data": self.pickle_serializer(obj),
 */
  if (unlikely(!__pyx_v_type_)) { __Pyx_RaiseUnboundLocalError("type_"); __PYX_ERR(14, 148, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_self->type_to_type_id, __pyx_v_type_); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_type_id = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/serialization.pxi":149
 *         # use the closest match to type(obj)
 *         type_id = self.type_to_type_id[type_]
 *         if type_id in self.types_to_pickle:             # <<<<<<<<<<<<<<
 *             serialized_obj = {"data": self.pickle_serializer(obj),
 *                               "pickle": True}
 */
  __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_v_type_id, __pyx_v_self->types_to_pickle, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(14, 149, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_6 != 0);
  if (__pyx_t_5) {

    /* "pyarrow/serialization.pxi":150
 *         type_id = self.type_to_type_id[type_]
 *         if type_id in self.types_to_pickle:
 *             serialized_obj = {"data": self.pickle_serializer(obj),             # <<<<<<<<<<<<<<
 *                               "pickle": True}
 *         elif type_id in self.custom_serializers:
 */
    __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_self->pickle_serializer);
    __pyx_t_9 = __pyx_v_self->pickle_serializer; __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
      }
    }
    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_7, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_data, __pyx_t_1) < 0) __PYX_ERR(14, 150, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/serialization.pxi":151
 *         if type_id in self.types_to_pickle:
 *             serialized_obj = {"data": self.pickle_serializer(obj),
 *                               "pickle": True}             # <<<<<<<<<<<<<<
 *         elif type_id in self.custom_serializers:
 *             serialized_obj = {"data": self.custom_serializers[type_id](obj)}
 */
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_pickle, Py_True) < 0) __PYX_ERR(14, 150, __pyx_L1_error)
    __pyx_v_serialized_obj = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyarrow/serialization.pxi":149
 *         # use the closest match to type(obj)
 *         type_id = self.type_to_type_id[type_]
 *         if type_id in self.types_to_pickle:             # <<<<<<<<<<<<<<
 *             serialized_obj = {"data": self.pickle_serializer(obj),
 *                               "pickle": True}
 */
    goto __pyx_L7;
  }

  /* "pyarrow/serialization.pxi":152
 *             serialized_obj = {"data": self.pickle_serializer(obj),
 *                               "pickle": True}
 *         elif type_id in self.custom_serializers:             # <<<<<<<<<<<<<<
 *             serialized_obj = {"data": self.custom_serializers[type_id](obj)}
 *         else:
 */
  __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_type_id, __pyx_v_self->custom_serializers, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(14, 152, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {

    /* "pyarrow/serialization.pxi":153
 *                               "pickle": True}
 *         elif type_id in self.custom_serializers:
 *             serialized_obj = {"data": self.custom_serializers[type_id](obj)}             # <<<<<<<<<<<<<<
 *         else:
 *             if is_named_tuple(type_):
 */
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_self->custom_serializers, __pyx_v_type_id); if (unlikely(!__pyx_t_9)) __PYX_ERR(14, 153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
      }
    }
    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_7, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_data, __pyx_t_1) < 0) __PYX_ERR(14, 153, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_serialized_obj = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyarrow/serialization.pxi":152
 *             serialized_obj = {"data": self.pickle_serializer(obj),
 *                               "pickle": True}
 *         elif type_id in self.custom_serializers:             # <<<<<<<<<<<<<<
 *             serialized_obj = {"data": self.custom_serializers[type_id](obj)}
 *         else:
 */
    goto __pyx_L7;
  }

  /* "pyarrow/serialization.pxi":155
 *             serialized_obj = {"data": self.custom_serializers[type_id](obj)}
 *         else:
 *             if is_named_tuple(type_):             # <<<<<<<<<<<<<<
 *                 serialized_obj = {}
 *                 serialized_obj["_pa_getnewargs_"] = obj.__getnewargs__()
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_named_tuple); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 155, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(!__pyx_v_type_)) { __Pyx_RaiseUnboundLocalError("type_"); __PYX_ERR(14, 155, __pyx_L1_error) }
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_9, __pyx_v_type_) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_type_);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 155, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(14, 155, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_6) {

      /* "pyarrow/serialization.pxi":156
 *         else:
 *             if is_named_tuple(type_):
 *                 serialized_obj = {}             # <<<<<<<<<<<<<<
 *                 serialized_obj["_pa_getnewargs_"] = obj.__getnewargs__()
 *             elif hasattr(obj, "__dict__"):
 */
      __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 156, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_serialized_obj = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "pyarrow/serialization.pxi":157
 *             if is_named_tuple(type_):
 *                 serialized_obj = {}
 *                 serialized_obj["_pa_getnewargs_"] = obj.__getnewargs__()             # <<<<<<<<<<<<<<
 *             elif hasattr(obj, "__dict__"):
 *                 serialized_obj = obj.__dict__
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_getnewargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 157, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 157, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(PyObject_SetItem(__pyx_v_serialized_obj, __pyx_n_u_pa_getnewargs, __pyx_t_2) < 0)) __PYX_ERR(14, 157, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyarrow/serialization.pxi":155
 *             serialized_obj = {"data": self.custom_serializers[type_id](obj)}
 *         else:
 *             if is_named_tuple(type_):             # <<<<<<<<<<<<<<
 *                 serialized_obj = {}
 *                 serialized_obj["_pa_getnewargs_"] = obj.__getnewargs__()
 */
      goto __pyx_L8;
    }

    /* "pyarrow/serialization.pxi":158
 *                 serialized_obj = {}
 *                 serialized_obj["_pa_getnewargs_"] = obj.__getnewargs__()
 *             elif hasattr(obj, "__dict__"):             # <<<<<<<<<<<<<<
 *                 serialized_obj = obj.__dict__
 *             else:
 */
    __pyx_t_6 = __Pyx_HasAttr(__pyx_v_obj, __pyx_n_u_dict); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(14, 158, __pyx_L1_error)
    __pyx_t_5 = (__pyx_t_6 != 0);
    if (likely(__pyx_t_5)) {

      /* "pyarrow/serialization.pxi":159
 *                 serialized_obj["_pa_getnewargs_"] = obj.__getnewargs__()
 *             elif hasattr(obj, "__dict__"):
 *                 serialized_obj = obj.__dict__             # <<<<<<<<<<<<<<
 *             else:
 *                 msg = "We do not know how to serialize " \
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 159, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_serialized_obj = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "pyarrow/serialization.pxi":158
 *                 serialized_obj = {}
 *                 serialized_obj["_pa_getnewargs_"] = obj.__getnewargs__()
 *             elif hasattr(obj, "__dict__"):             # <<<<<<<<<<<<<<
 *                 serialized_obj = obj.__dict__
 *             else:
 */
      goto __pyx_L8;
    }

    /* "pyarrow/serialization.pxi":161
 *                 serialized_obj = obj.__dict__
 *             else:
 *                 msg = "We do not know how to serialize " \             # <<<<<<<<<<<<<<
 *                       "the object '{}'".format(obj)
 *                 raise SerializationCallbackError(msg, obj)
 */
    /*else*/ {

      /* "pyarrow/serialization.pxi":162
 *             else:
 *                 msg = "We do not know how to serialize " \
 *                       "the object '{}'".format(obj)             # <<<<<<<<<<<<<<
 *                 raise SerializationCallbackError(msg, obj)
 *         return dict(serialized_obj, **{"_pytype_": type_id})
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_We_do_not_know_how_to_serialize, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 162, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_9, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_obj);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 162, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_msg = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "pyarrow/serialization.pxi":163
 *                 msg = "We do not know how to serialize " \
 *                       "the object '{}'".format(obj)
 *                 raise SerializationCallbackError(msg, obj)             # <<<<<<<<<<<<<<
 *         return dict(serialized_obj, **{"_pytype_": type_id})
 * 
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SerializationCallbackError); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = NULL;
      __pyx_t_10 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_10 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_msg, __pyx_v_obj};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 163, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_msg, __pyx_v_obj};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 163, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 163, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_9) {
          __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __pyx_t_9 = NULL;
        }
        __Pyx_INCREF(__pyx_v_msg);
        __Pyx_GIVEREF(__pyx_v_msg);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_10, __pyx_v_msg);
        __Pyx_INCREF(__pyx_v_obj);
        __Pyx_GIVEREF(__pyx_v_obj);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_10, __pyx_v_obj);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 163, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(14, 163, __pyx_L1_error)
    }
    __pyx_L8:;
  }
  __pyx_L7:;

  /* "pyarrow/serialization.pxi":164
 *                       "the object '{}'".format(obj)
 *                 raise SerializationCallbackError(msg, obj)
 *         return dict(serialized_obj, **{"_pytype_": type_id})             # <<<<<<<<<<<<<<
 * 
 *     def _deserialize_callback(self, serialized_obj):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_serialized_obj);
  __Pyx_GIVEREF(__pyx_v_serialized_obj);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_serialized_obj);
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_pytype, __pyx_v_type_id) < 0) __PYX_ERR(14, 164, __pyx_L1_error)
  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyDict_Type)), __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":134
 *             self.custom_deserializers[type_id] = custom_deserializer
 * 
 *     def _serialize_callback(self, obj):             # <<<<<<<<<<<<<<
 *         found = False
 *         for type_ in type(obj).__mro__:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyarrow.lib.SerializationContext._serialize_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_type_);
  __Pyx_XDECREF(__pyx_v_type_id);
  __Pyx_XDECREF(__pyx_v_serialized_obj);
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":166
 *         return dict(serialized_obj, **{"_pytype_": type_id})
 * 
 *     def _deserialize_callback(self, serialized_obj):             # <<<<<<<<<<<<<<
 *         type_id = serialized_obj["_pytype_"]
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_11_deserialize_callback(PyObject *__pyx_v_self, PyObject *__pyx_v_serialized_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20SerializationContext_10_deserialize_callback[] = "SerializationContext._deserialize_callback(self, serialized_obj)";
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_11_deserialize_callback(PyObject *__pyx_v_self, PyObject *__pyx_v_serialized_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_deserialize_callback (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20SerializationContext_10_deserialize_callback(((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_v_self), ((PyObject *)__pyx_v_serialized_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_10_deserialize_callback(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_serialized_obj) {
  PyObject *__pyx_v_type_id = NULL;
  PyObject *__pyx_v_obj = NULL;
  PyObject *__pyx_v_msg = NULL;
  PyObject *__pyx_v_type_ = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("_deserialize_callback", 0);

  /* "pyarrow/serialization.pxi":167
 * 
 *     def _deserialize_callback(self, serialized_obj):
 *         type_id = serialized_obj["_pytype_"]             # <<<<<<<<<<<<<<
 * 
 *         if "pickle" in serialized_obj:
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_serialized_obj, __pyx_n_u_pytype); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_type_id = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":169
 *         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_u_pickle, __pyx_v_serialized_obj, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(14, 169, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/serialization.pxi":171
 *         if "pickle" in serialized_obj:
 *             # The object was pickled, so unpickle it.
 *             obj = self.pickle_deserializer(serialized_obj["data"])             # <<<<<<<<<<<<<<
 *         else:
 *             assert type_id not in self.types_to_pickle
 */
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_serialized_obj, __pyx_n_u_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 171, __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, 171, __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":169
 *         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":173
 *             obj = self.pickle_deserializer(serialized_obj["data"])
 *         else:
 *             assert type_id not in self.types_to_pickle             # <<<<<<<<<<<<<<
 *             if type_id not in self.whitelisted_types:
 *                 msg = "Type ID " + type_id + " not registered in " \
 */
  /*else*/ {
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(!Py_OptimizeFlag)) {
      __pyx_t_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, 173, __pyx_L1_error)
      if (unlikely(!(__pyx_t_3 != 0))) {
        PyErr_SetNone(PyExc_AssertionError);
        __PYX_ERR(14, 173, __pyx_L1_error)
      }
    }
    #endif

    /* "pyarrow/serialization.pxi":174
 *         else:
 *             assert type_id not in self.types_to_pickle
 *             if type_id not in self.whitelisted_types:             # <<<<<<<<<<<<<<
 *                 msg = "Type ID " + type_id + " not registered in " \
 *                       "deserialization callback"
 */
    __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_type_id, __pyx_v_self->whitelisted_types, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(14, 174, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (unlikely(__pyx_t_2)) {

      /* "pyarrow/serialization.pxi":175
 *             assert type_id not in self.types_to_pickle
 *             if type_id not in self.whitelisted_types:
 *                 msg = "Type ID " + type_id + " not registered in " \             # <<<<<<<<<<<<<<
 *                       "deserialization callback"
 *                 raise DeserializationCallbackError(msg, type_id)
 */
      __pyx_t_1 = PyNumber_Add(__pyx_kp_u_Type_ID, __pyx_v_type_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 175, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_kp_u_not_registered_in_deserializati); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 175, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_msg = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "pyarrow/serialization.pxi":177
 *                 msg = "Type ID " + type_id + " not registered in " \
 *                       "deserialization callback"
 *                 raise DeserializationCallbackError(msg, type_id)             # <<<<<<<<<<<<<<
 *             type_ = self.whitelisted_types[type_id]
 *             if type_id in self.custom_deserializers:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_DeserializationCallbackError); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 177, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_msg, __pyx_v_type_id};
        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 177, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_msg, __pyx_v_type_id};
        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 177, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 177, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_msg);
        __Pyx_GIVEREF(__pyx_v_msg);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_v_msg);
        __Pyx_INCREF(__pyx_v_type_id);
        __Pyx_GIVEREF(__pyx_v_type_id);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_type_id);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 177, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_ERR(14, 177, __pyx_L1_error)

      /* "pyarrow/serialization.pxi":174
 *         else:
 *             assert type_id not in self.types_to_pickle
 *             if type_id not in self.whitelisted_types:             # <<<<<<<<<<<<<<
 *                 msg = "Type ID " + type_id + " not registered in " \
 *                       "deserialization callback"
 */
    }

    /* "pyarrow/serialization.pxi":178
 *                       "deserialization callback"
 *                 raise DeserializationCallbackError(msg, type_id)
 *             type_ = self.whitelisted_types[type_id]             # <<<<<<<<<<<<<<
 *             if type_id in self.custom_deserializers:
 *                 obj = self.custom_deserializers[type_id](
 */
    __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_self->whitelisted_types, __pyx_v_type_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 178, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_v_type_ = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "pyarrow/serialization.pxi":179
 *                 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, 179, __pyx_L1_error)
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "pyarrow/serialization.pxi":180
 *             type_ = self.whitelisted_types[type_id]
 *             if type_id in self.custom_deserializers:
 *                 obj = self.custom_deserializers[type_id](             # <<<<<<<<<<<<<<
 *                     serialized_obj["data"])
 *             else:
 */
      __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_self->custom_deserializers, __pyx_v_type_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);

      /* "pyarrow/serialization.pxi":181
 *             if type_id in self.custom_deserializers:
 *                 obj = self.custom_deserializers[type_id](
 *                     serialized_obj["data"])             # <<<<<<<<<<<<<<
 *             else:
 *                 # In this case, serialized_obj should just be
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_serialized_obj, __pyx_n_u_data); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_obj = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "pyarrow/serialization.pxi":179
 *                 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":185
 *                 # 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_u_pa_getnewargs, __pyx_v_serialized_obj, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(14, 185, __pyx_L1_error)
      __pyx_t_2 = (__pyx_t_3 != 0);
      if (__pyx_t_2) {

        /* "pyarrow/serialization.pxi":186
 *                 # the __dict__ field.
 *                 if "_pa_getnewargs_" in serialized_obj:
 *                     obj = type_.__new__(             # <<<<<<<<<<<<<<
 *                         type_, *serialized_obj["_pa_getnewargs_"])
 *                 else:
 */
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_type_, __pyx_n_s_new); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 186, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);

        /* "pyarrow/serialization.pxi":187
 *                 if "_pa_getnewargs_" in serialized_obj:
 *                     obj = type_.__new__(
 *                         type_, *serialized_obj["_pa_getnewargs_"])             # <<<<<<<<<<<<<<
 *                 else:
 *                     obj = type_.__new__(type_)
 */
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 186, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_v_type_);
        __Pyx_GIVEREF(__pyx_v_type_);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_type_);
        __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_serialized_obj, __pyx_n_u_pa_getnewargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 187, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);

        /* "pyarrow/serialization.pxi":186
 *                 # 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, 186, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 186, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 186, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_v_obj = __pyx_t_4;
        __pyx_t_4 = 0;

        /* "pyarrow/serialization.pxi":185
 *                 # 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":189
 *                         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, 189, __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(14, 189, __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":190
 *                 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, 190, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_n_u_pytype) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_n_u_pytype);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 190, __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":191
 *                     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, 191, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 191, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
          }
        }
        __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_serialized_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_serialized_obj);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 191, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __pyx_L6:;
    }
    __pyx_L5:;
  }
  __pyx_L3:;

  /* "pyarrow/serialization.pxi":192
 *                     serialized_obj.pop("_pytype_")
 *                     obj.__dict__.update(serialized_obj)
 *         return obj             # <<<<<<<<<<<<<<
 * 
 *     def serialize(self, obj):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_obj);
  __pyx_r = __pyx_v_obj;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":166
 *         return dict(serialized_obj, **{"_pytype_": type_id})
 * 
 *     def _deserialize_callback(self, serialized_obj):             # <<<<<<<<<<<<<<
 *         type_id = serialized_obj["_pytype_"]
 * 
 */

  /* 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":194
 *         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":198
 *         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, 198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 198, __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, 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 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":200
 *         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, 200, __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, 200, __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, 200, __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":204
 *         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, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 204, __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, 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(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":206
 *         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":210
 *         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, 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 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":212
 *         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":216
 *         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, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 216, __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, 216, __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, 216, __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, 216, __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":212
 *         return deserialize(what, context=self)
 * 
 *     def deserialize_components(self, what):             # <<<<<<<<<<<<<<
 *         """
 *         Call pyarrow.deserialize_components and pass this SerializationContext
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.SerializationContext.deserialize_components", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20SerializationContext_20__reduce_cython__[] = "SerializationContext.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20SerializationContext_20__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_20__reduce_cython__(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.custom_deserializers, self.custom_serializers, self.pickle_deserializer, self.pickle_serializer, self.type_to_type_id, self.types_to_pickle, self.whitelisted_types)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->custom_deserializers);
  __Pyx_GIVEREF(__pyx_v_self->custom_deserializers);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->custom_deserializers);
  __Pyx_INCREF(__pyx_v_self->custom_serializers);
  __Pyx_GIVEREF(__pyx_v_self->custom_serializers);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->custom_serializers);
  __Pyx_INCREF(__pyx_v_self->pickle_deserializer);
  __Pyx_GIVEREF(__pyx_v_self->pickle_deserializer);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_self->pickle_deserializer);
  __Pyx_INCREF(__pyx_v_self->pickle_serializer);
  __Pyx_GIVEREF(__pyx_v_self->pickle_serializer);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_self->pickle_serializer);
  __Pyx_INCREF(__pyx_v_self->type_to_type_id);
  __Pyx_GIVEREF(__pyx_v_self->type_to_type_id);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_self->type_to_type_id);
  __Pyx_INCREF(__pyx_v_self->types_to_pickle);
  __Pyx_GIVEREF(__pyx_v_self->types_to_pickle);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_v_self->types_to_pickle);
  __Pyx_INCREF(__pyx_v_self->whitelisted_types);
  __Pyx_GIVEREF(__pyx_v_self->whitelisted_types);
  PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_v_self->whitelisted_types);
  __pyx_v_state = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.custom_deserializers, self.custom_serializers, self.pickle_deserializer, self.pickle_serializer, self.type_to_type_id, self.types_to_pickle, self.whitelisted_types)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = (self.custom_deserializers, self.custom_serializers, self.pickle_deserializer, self.pickle_serializer, self.type_to_type_id, self.types_to_pickle, self.whitelisted_types)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_2 = (__pyx_v__dict != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.custom_deserializers is not None or self.custom_serializers is not None or self.pickle_deserializer is not None or self.pickle_serializer is not None or self.type_to_type_id is not None or self.types_to_pickle is not None or self.whitelisted_types is not None
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.custom_deserializers, self.custom_serializers, self.pickle_deserializer, self.pickle_serializer, self.type_to_type_id, self.types_to_pickle, self.whitelisted_types)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.custom_deserializers is not None or self.custom_serializers is not None or self.pickle_deserializer is not None or self.pickle_serializer is not None or self.type_to_type_id is not None or self.types_to_pickle is not None or self.whitelisted_types is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_SerializationContext, (type(self), 0x9aeed6f, None), state
 */
  /*else*/ {
    __pyx_t_2 = (__pyx_v_self->custom_deserializers != Py_None);
    __pyx_t_5 = (__pyx_t_2 != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_3 = __pyx_t_5;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_5 = (__pyx_v_self->custom_serializers != Py_None);
    __pyx_t_2 = (__pyx_t_5 != 0);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_3 = __pyx_t_2;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_2 = (__pyx_v_self->pickle_deserializer != Py_None);
    __pyx_t_5 = (__pyx_t_2 != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_3 = __pyx_t_5;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_5 = (__pyx_v_self->pickle_serializer != Py_None);
    __pyx_t_2 = (__pyx_t_5 != 0);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_3 = __pyx_t_2;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_2 = (__pyx_v_self->type_to_type_id != Py_None);
    __pyx_t_5 = (__pyx_t_2 != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_3 = __pyx_t_5;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_5 = (__pyx_v_self->types_to_pickle != Py_None);
    __pyx_t_2 = (__pyx_t_5 != 0);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_3 = __pyx_t_2;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_2 = (__pyx_v_self->whitelisted_types != Py_None);
    __pyx_t_5 = (__pyx_t_2 != 0);
    __pyx_t_3 = __pyx_t_5;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_3;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.custom_deserializers is not None or self.custom_serializers is not None or self.pickle_deserializer is not None or self.pickle_serializer is not None or self.type_to_type_id is not None or self.types_to_pickle is not None or self.whitelisted_types is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_SerializationContext, (type(self), 0x9aeed6f, None), state
 *     else:
 */
  __pyx_t_3 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_3) {

    /* "(tree fragment)":13
 *         use_setstate = self.custom_deserializers is not None or self.custom_serializers is not None or self.pickle_deserializer is not None or self.pickle_serializer is not None or self.type_to_type_id is not None or self.types_to_pickle is not None or self.whitelisted_types is not None
 *     if use_setstate:
 *         return __pyx_unpickle_SerializationContext, (type(self), 0x9aeed6f, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_SerializationContext, (type(self), 0x9aeed6f, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_SerializationCont); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_162458991);
    __Pyx_GIVEREF(__pyx_int_162458991);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_162458991);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
    __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_state);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.custom_deserializers is not None or self.custom_serializers is not None or self.pickle_deserializer is not None or self.pickle_serializer is not None or self.type_to_type_id is not None or self.types_to_pickle is not None or self.whitelisted_types is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_SerializationContext, (type(self), 0x9aeed6f, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_SerializationContext, (type(self), 0x9aeed6f, None), state
 *     else:
 *         return __pyx_unpickle_SerializationContext, (type(self), 0x9aeed6f, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_SerializationContext__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pyx_unpickle_SerializationCont); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_162458991);
    __Pyx_GIVEREF(__pyx_int_162458991);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_162458991);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
    __pyx_t_6 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.SerializationContext.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_SerializationContext, (type(self), 0x9aeed6f, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_SerializationContext__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20SerializationContext_22__setstate_cython__[] = "SerializationContext.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20SerializationContext_22__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_22__setstate_cython__(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_SerializationContext, (type(self), 0x9aeed6f, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_SerializationContext__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(9, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_7pyarrow_3lib___pyx_unpickle_SerializationContext__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_SerializationContext, (type(self), 0x9aeed6f, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_SerializationContext__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SerializationContext.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":223
 * 
 * 
 * def _get_default_context():             # <<<<<<<<<<<<<<
 *     global _default_context_initialized
 *     from pyarrow.serialization import register_default_serialization_handlers
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_155_get_default_context(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_154_get_default_context[] = "_get_default_context()";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_155_get_default_context = {"_get_default_context", (PyCFunction)__pyx_pw_7pyarrow_3lib_155_get_default_context, METH_NOARGS, __pyx_doc_7pyarrow_3lib_154_get_default_context};
static PyObject *__pyx_pw_7pyarrow_3lib_155_get_default_context(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_default_context (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_154_get_default_context(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_154_get_default_context(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_register_default_serialization_handlers = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("_get_default_context", 0);

  /* "pyarrow/serialization.pxi":225
 * def _get_default_context():
 *     global _default_context_initialized
 *     from pyarrow.serialization import register_default_serialization_handlers             # <<<<<<<<<<<<<<
 *     if not _default_context_initialized:
 *         register_default_serialization_handlers(_default_serialization_context)
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_register_default_serialization_h);
  __Pyx_GIVEREF(__pyx_n_s_register_default_serialization_h);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_register_default_serialization_h);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_pyarrow_serialization, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_register_default_serialization_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_register_default_serialization_handlers = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/serialization.pxi":226
 *     global _default_context_initialized
 *     from pyarrow.serialization import register_default_serialization_handlers
 *     if not _default_context_initialized:             # <<<<<<<<<<<<<<
 *         register_default_serialization_handlers(_default_serialization_context)
 *         _default_context_initialized = True
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_default_context_initialized); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(14, 226, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = ((!__pyx_t_3) != 0);
  if (__pyx_t_4) {

    /* "pyarrow/serialization.pxi":227
 *     from pyarrow.serialization import register_default_serialization_handlers
 *     if not _default_context_initialized:
 *         register_default_serialization_handlers(_default_serialization_context)             # <<<<<<<<<<<<<<
 *         _default_context_initialized = True
 *     return _default_serialization_context
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_default_serialization_context); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 227, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_register_default_serialization_handlers);
    __pyx_t_5 = __pyx_v_register_default_serialization_handlers; __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 227, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pyarrow/serialization.pxi":228
 *     if not _default_context_initialized:
 *         register_default_serialization_handlers(_default_serialization_context)
 *         _default_context_initialized = True             # <<<<<<<<<<<<<<
 *     return _default_serialization_context
 * 
 */
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_context_initialized, Py_True) < 0) __PYX_ERR(14, 228, __pyx_L1_error)

    /* "pyarrow/serialization.pxi":226
 *     global _default_context_initialized
 *     from pyarrow.serialization import register_default_serialization_handlers
 *     if not _default_context_initialized:             # <<<<<<<<<<<<<<
 *         register_default_serialization_handlers(_default_serialization_context)
 *         _default_context_initialized = True
 */
  }

  /* "pyarrow/serialization.pxi":229
 *         register_default_serialization_handlers(_default_serialization_context)
 *         _default_context_initialized = True
 *     return _default_serialization_context             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_default_serialization_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":223
 * 
 * 
 * def _get_default_context():             # <<<<<<<<<<<<<<
 *     global _default_context_initialized
 *     from pyarrow.serialization import register_default_serialization_handlers
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib._get_default_context", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_register_default_serialization_handlers);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":243
 * 
 *     @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":245
 *     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":246
 *         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, 246, __pyx_L4_error)
      }

      /* "pyarrow/serialization.pxi":245
 *     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":248
 *             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, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":243
 * 
 *     @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":250
 *         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":255
 *         """
 *         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, 255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":256
 *         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, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":250
 *         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":258
 *         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":259
 * 
 *     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":260
 *     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, 260, __pyx_L4_error)
      }

      /* "pyarrow/serialization.pxi":259
 * 
 *     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":258
 *         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":262
 *             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, 262, __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, 262, __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, 262, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_18SerializedPyObject_2deserialize(((struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *)__pyx_v_self), __pyx_v_context);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_2deserialize(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context) {
  PyObject *__pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("deserialize", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_context);

  /* "pyarrow/serialization.pxi":268
 *         cdef PyObject* result
 * 
 *         if context is None:             # <<<<<<<<<<<<<<
 *             context = _get_default_context()
 * 
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_context) == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/serialization.pxi":269
 * 
 *         if context is None:
 *             context = _get_default_context()             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_get_default_context); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 269, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 269, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_SerializationContext))))) __PYX_ERR(14, 269, __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":268
 *         cdef PyObject* result
 * 
 *         if context is None:             # <<<<<<<<<<<<<<
 *             context = _get_default_context()
 * 
 */
  }

  /* "pyarrow/serialization.pxi":271
 *             context = _get_default_context()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(DeserializeObject(context, self.data,
 *                                            <PyObject*> self.base, &result))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/serialization.pxi":272
 * 
 *         with nogil:
 *             check_status(DeserializeObject(context, self.data,             # <<<<<<<<<<<<<<
 *                                            <PyObject*> self.base, &result))
 * 
 */
        __pyx_t_6 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::DeserializeObject(((PyObject *)__pyx_v_context), __pyx_v_self->data, ((PyObject *)__pyx_v_self->base), (&__pyx_v_result))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(14, 272, __pyx_L5_error)
      }

      /* "pyarrow/serialization.pxi":271
 *             context = _get_default_context()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(DeserializeObject(context, self.data,
 *                                            <PyObject*> self.base, &result))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L6;
        }
        __pyx_L5_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L6:;
      }
  }

  /* "pyarrow/serialization.pxi":277
 *         # 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, 277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 277, __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":262
 *             check_status(self.data.WriteTo(stream))
 * 
 *     def deserialize(self, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert back to Python object
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.SerializedPyObject.deserialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_context);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":279
 *         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, 279, __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, 279, __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":283
 *         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, 283, __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, 283, __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, 283, __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, 283, __pyx_L1_error)
  __pyx_v_output = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":284
 *         """
 *         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, 284, __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":285
 *         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, 285, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(14, 285, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {

    /* "pyarrow/serialization.pxi":286
 *         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, 286, __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, 286, __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":285
 *         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":287
 *         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, 287, __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, 287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":288
 *             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":279
 *         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":291
 * 
 *     @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, 291, __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, 291, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.SerializedPyObject.from_components", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_18SerializedPyObject_6from_components(__pyx_v_components);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_6from_components(PyObject *__pyx_v_components) {
  int __pyx_v_num_tensors;
  int __pyx_v_num_ndarrays;
  int __pyx_v_num_buffers;
  PyObject *__pyx_v_buffers = 0;
  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":297
 *         """
 *         cdef:
 *             int num_tensors = components['num_tensors']             # <<<<<<<<<<<<<<
 *             int num_ndarrays = components['num_ndarrays']
 *             int num_buffers = components['num_buffers']
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_components, __pyx_n_u_num_tensors); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 297, __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, 297, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_num_tensors = __pyx_t_2;

  /* "pyarrow/serialization.pxi":298
 *         cdef:
 *             int num_tensors = components['num_tensors']
 *             int num_ndarrays = components['num_ndarrays']             # <<<<<<<<<<<<<<
 *             int num_buffers = components['num_buffers']
 *             list buffers = components['data']
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_components, __pyx_n_u_num_ndarrays); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 298, __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, 298, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_num_ndarrays = __pyx_t_2;

  /* "pyarrow/serialization.pxi":299
 *             int num_tensors = components['num_tensors']
 *             int num_ndarrays = components['num_ndarrays']
 *             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_u_num_buffers); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 299, __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, 299, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_num_buffers = __pyx_t_2;

  /* "pyarrow/serialization.pxi":300
 *             int num_ndarrays = components['num_ndarrays']
 *             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_u_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 300, __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, 300, __pyx_L1_error)
  __pyx_v_buffers = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":301
 *             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, 301, __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":303
 *             SerializedPyObject result = SerializedPyObject()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(GetSerializedFromComponents(num_tensors, num_ndarrays,
 *                                                      num_buffers,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/serialization.pxi":304
 * 
 *         with nogil:
 *             check_status(GetSerializedFromComponents(num_tensors, num_ndarrays,             # <<<<<<<<<<<<<<
 *                                                      num_buffers,
 *                                                      buffers, &result.data))
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::GetSerializedFromComponents(__pyx_v_num_tensors, __pyx_v_num_ndarrays, __pyx_v_num_buffers, __pyx_v_buffers, (&__pyx_v_result->data))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(14, 304, __pyx_L4_error)
      }

      /* "pyarrow/serialization.pxi":303
 *             SerializedPyObject result = SerializedPyObject()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(GetSerializedFromComponents(num_tensors, num_ndarrays,
 *                                                      num_buffers,
 */
      /*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":308
 *                                                      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":291
 * 
 *     @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":310
 *         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, 310, __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, 310, __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":325
 *         """
 *         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, 325, __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":327
 *         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":328
 * 
 *         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, 328, __pyx_L4_error)
      }

      /* "pyarrow/serialization.pxi":327
 *         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":330
 *             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, 330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":310
 *         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":240
 * 
 *     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__219, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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__220, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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":333
 * 
 * 
 * def serialize(object value, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Serialize a Python sequence
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_157serialize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_156serialize[] = "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_157serialize = {"serialize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_157serialize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_156serialize};
static PyObject *__pyx_pw_7pyarrow_3lib_157serialize(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, 333, __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, 333, __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, 333, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_156serialize(__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_156serialize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value, struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context) {
  struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_serialized = 0;
  PyObject *__pyx_v_wrapped_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("serialize", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_context);

  /* "pyarrow/serialization.pxi":348
 *     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, 348, __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":349
 *     """
 *     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, 349, __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":351
 *     wrapped_value = [value]
 * 
 *     if context is None:             # <<<<<<<<<<<<<<
 *         context = _get_default_context()
 * 
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_context) == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/serialization.pxi":352
 * 
 *     if context is None:
 *         context = _get_default_context()             # <<<<<<<<<<<<<<
 * 
 *     with nogil:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_get_default_context); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 352, __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(14, 352, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_SerializationContext))))) __PYX_ERR(14, 352, __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":351
 *     wrapped_value = [value]
 * 
 *     if context is None:             # <<<<<<<<<<<<<<
 *         context = _get_default_context()
 * 
 */
  }

  /* "pyarrow/serialization.pxi":354
 *         context = _get_default_context()
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(SerializeObject(context, wrapped_value, &serialized.data))
 *     return serialized
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/serialization.pxi":355
 * 
 *     with nogil:
 *         check_status(SerializeObject(context, wrapped_value, &serialized.data))             # <<<<<<<<<<<<<<
 *     return serialized
 * 
 */
        __pyx_t_6 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::SerializeObject(((PyObject *)__pyx_v_context), __pyx_v_wrapped_value, (&__pyx_v_serialized->data))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(14, 355, __pyx_L5_error)
      }

      /* "pyarrow/serialization.pxi":354
 *         context = _get_default_context()
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(SerializeObject(context, wrapped_value, &serialized.data))
 *     return serialized
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L6;
        }
        __pyx_L5_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L6:;
      }
  }

  /* "pyarrow/serialization.pxi":356
 *     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":333
 * 
 * 
 * def serialize(object value, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Serialize a Python sequence
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.serialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_serialized);
  __Pyx_XDECREF(__pyx_v_wrapped_value);
  __Pyx_XDECREF((PyObject *)__pyx_v_context);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":359
 * 
 * 
 * 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_159serialize_to(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_158serialize_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_159serialize_to = {"serialize_to", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_159serialize_to, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_158serialize_to};
static PyObject *__pyx_pw_7pyarrow_3lib_159serialize_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, 359, __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, 359, __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, 359, __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, 359, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_158serialize_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_158serialize_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":372
 *         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, 372, __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, 372, __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, 372, __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, 372, __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, 372, __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":373
 *     """
 *     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, 373, __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, 373, __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":359
 * 
 * 
 * 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":376
 * 
 * 
 * def read_serialized(source, base=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Read serialized Python sequence from file-like object
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_161read_serialized(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_160read_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_161read_serialized = {"read_serialized", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_161read_serialized, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_160read_serialized};
static PyObject *__pyx_pw_7pyarrow_3lib_161read_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, 376, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_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, 376, __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_160read_serialized(__pyx_self, __pyx_v_source, __pyx_v_base);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_160read_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":392
 *     """
 *     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, 392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":394
 *     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, 394, __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":395
 * 
 *     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":396
 *     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":397
 *     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, 397, __pyx_L4_error)
      }

      /* "pyarrow/serialization.pxi":396
 *     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":399
 *         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":376
 * 
 * 
 * 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":402
 * 
 * 
 * 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_163deserialize_from(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_162deserialize_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_163deserialize_from = {"deserialize_from", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_163deserialize_from, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_162deserialize_from};
static PyObject *__pyx_pw_7pyarrow_3lib_163deserialize_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, 402, __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, 402, __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, 402, __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, 402, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_162deserialize_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_162deserialize_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":420
 *         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, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 420, __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, 420, __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, 420, __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, 420, __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":421
 *     """
 *     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, 421, __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, 421, __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":402
 * 
 * 
 * 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":424
 * 
 * 
 * def deserialize_components(components, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """
 *     Reconstruct Python object from output of SerializedPyObject.to_components
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_165deserialize_components(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_164deserialize_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_165deserialize_components = {"deserialize_components", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_165deserialize_components, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_164deserialize_components};
static PyObject *__pyx_pw_7pyarrow_3lib_165deserialize_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, 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_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, 424, __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, 424, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_164deserialize_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_164deserialize_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":438
 *     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, 438, __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, 438, __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":439
 *     """
 *     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, 439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_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, 439, __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":424
 * 
 * 
 * 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":442
 * 
 * 
 * def deserialize(obj, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """
 *     EXPERIMENTAL: Deserialize Python object from Buffer or other Python object
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_167deserialize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_166deserialize[] = "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_167deserialize = {"deserialize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_167deserialize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_166deserialize};
static PyObject *__pyx_pw_7pyarrow_3lib_167deserialize(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, 442, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_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, 442, __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, 442, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_166deserialize(__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_166deserialize(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":457
 *     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, 457, __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":458
 *     """
 *     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, 458, __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, 458, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[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, 458, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(((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, 458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":442
 * 
 * 
 * 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_169benchmark_PandasObjectIsNull(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_168benchmark_PandasObjectIsNull[] = "benchmark_PandasObjectIsNull(list obj)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_169benchmark_PandasObjectIsNull = {"benchmark_PandasObjectIsNull", (PyCFunction)__pyx_pw_7pyarrow_3lib_169benchmark_PandasObjectIsNull, METH_O, __pyx_doc_7pyarrow_3lib_168benchmark_PandasObjectIsNull};
static PyObject *__pyx_pw_7pyarrow_3lib_169benchmark_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_168benchmark_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_168benchmark_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 api bint pyarrow_is_buffer(object buffer):             # <<<<<<<<<<<<<<
 *     return isinstance(buffer, Buffer)
 * 
 */

static int __pyx_f_7pyarrow_3lib_pyarrow_is_buffer(PyObject *__pyx_v_buffer) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("pyarrow_is_buffer", 0);

  /* "pyarrow/public-api.pxi":28
 * 
 * cdef api bint pyarrow_is_buffer(object buffer):
 *     return isinstance(buffer, Buffer)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_buffer, __pyx_ptype_7pyarrow_3lib_Buffer); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":27
 * 
 * 
 * cdef api bint pyarrow_is_buffer(object buffer):             # <<<<<<<<<<<<<<
 *     return isinstance(buffer, Buffer)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":31
 * 
 * 
 * cdef api shared_ptr[CBuffer] pyarrow_unwrap_buffer(object buffer):             # <<<<<<<<<<<<<<
 *     cdef Buffer buf
 *     if pyarrow_is_buffer(buffer):
 */

std::shared_ptr< arrow::Buffer>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_buffer(PyObject *__pyx_v_buffer) {
  struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_buf = 0;
  std::shared_ptr< arrow::Buffer>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_unwrap_buffer", 0);

  /* "pyarrow/public-api.pxi":33
 * cdef api shared_ptr[CBuffer] pyarrow_unwrap_buffer(object buffer):
 *     cdef Buffer buf
 *     if pyarrow_is_buffer(buffer):             # <<<<<<<<<<<<<<
 *         buf = <Buffer>(buffer)
 *         return buf.buffer
 */
  __pyx_t_1 = (__pyx_f_7pyarrow_3lib_pyarrow_is_buffer(__pyx_v_buffer) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":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 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 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 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 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 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 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 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 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 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 api bint pyarrow_is_data_type(object type_):             # <<<<<<<<<<<<<<
 *     return isinstance(type_, DataType)
 * 
 */

static int __pyx_f_7pyarrow_3lib_pyarrow_is_data_type(PyObject *__pyx_v_type_) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("pyarrow_is_data_type", 0);

  /* "pyarrow/public-api.pxi":54
 * 
 * cdef api bint pyarrow_is_data_type(object type_):
 *     return isinstance(type_, DataType)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_type_, __pyx_ptype_7pyarrow_3lib_DataType); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":53
 * 
 * 
 * cdef api bint pyarrow_is_data_type(object type_):             # <<<<<<<<<<<<<<
 *     return isinstance(type_, DataType)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":57
 * 
 * 
 * cdef api shared_ptr[CDataType] pyarrow_unwrap_data_type(             # <<<<<<<<<<<<<<
 *         object data_type):
 *     cdef DataType type_
 */

std::shared_ptr< arrow::DataType>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_data_type(PyObject *__pyx_v_data_type) {
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type_ = 0;
  std::shared_ptr< arrow::DataType>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_unwrap_data_type", 0);

  /* "pyarrow/public-api.pxi":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 = (__pyx_f_7pyarrow_3lib_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 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 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 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 object pyarrow_wrap_metadata(             # <<<<<<<<<<<<<<
 *         const shared_ptr[const CKeyValueMetadata]& meta):
 *     cdef const CKeyValueMetadata* cmeta = meta.get()
 */

static PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_metadata(std::shared_ptr< arrow::KeyValueMetadata const >  const &__pyx_v_meta) {
   arrow::KeyValueMetadata const *__pyx_v_cmeta;
  PyObject *__pyx_v_result = NULL;
  int64_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int64_t __pyx_t_5;
  int64_t __pyx_t_6;
  int64_t __pyx_t_7;
  __Pyx_RefNannySetupContext("pyarrow_wrap_metadata", 0);

  /* "pyarrow/public-api.pxi":97
 * cdef object pyarrow_wrap_metadata(
 *         const shared_ptr[const CKeyValueMetadata]& meta):
 *     cdef const CKeyValueMetadata* cmeta = meta.get()             # <<<<<<<<<<<<<<
 * 
 *     if cmeta == nullptr:
 */
  __pyx_v_cmeta = __pyx_v_meta.get();

  /* "pyarrow/public-api.pxi":99
 *     cdef const CKeyValueMetadata* cmeta = meta.get()
 * 
 *     if cmeta == nullptr:             # <<<<<<<<<<<<<<
 *         return None
 * 
 */
  __pyx_t_1 = ((__pyx_v_cmeta == nullptr) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":100
 * 
 *     if cmeta == nullptr:
 *         return None             # <<<<<<<<<<<<<<
 * 
 *     result = OrderedDict()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/public-api.pxi":99
 *     cdef const CKeyValueMetadata* cmeta = meta.get()
 * 
 *     if cmeta == nullptr:             # <<<<<<<<<<<<<<
 *         return None
 * 
 */
  }

  /* "pyarrow/public-api.pxi":102
 *         return None
 * 
 *     result = OrderedDict()             # <<<<<<<<<<<<<<
 *     for i in range(cmeta.size()):
 *         result[cmeta.key(i)] = cmeta.value(i)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/public-api.pxi":103
 * 
 *     result = OrderedDict()
 *     for i in range(cmeta.size()):             # <<<<<<<<<<<<<<
 *         result[cmeta.key(i)] = cmeta.value(i)
 * 
 */
  __pyx_t_5 = __pyx_v_cmeta->size();
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "pyarrow/public-api.pxi":104
 *     result = OrderedDict()
 *     for i in range(cmeta.size()):
 *         result[cmeta.key(i)] = cmeta.value(i)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
    __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_cmeta->value(__pyx_v_i)); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_cmeta->key(__pyx_v_i)); if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(PyObject_SetItem(__pyx_v_result, __pyx_t_3, __pyx_t_2) < 0)) __PYX_ERR(16, 104, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "pyarrow/public-api.pxi":106
 *         result[cmeta.key(i)] = cmeta.value(i)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":95
 * 
 * 
 * cdef object pyarrow_wrap_metadata(             # <<<<<<<<<<<<<<
 *         const shared_ptr[const CKeyValueMetadata]& meta):
 *     cdef const CKeyValueMetadata* cmeta = meta.get()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":109
 * 
 * 
 * cdef shared_ptr[CKeyValueMetadata] pyarrow_unwrap_metadata(object meta):             # <<<<<<<<<<<<<<
 *     cdef vector[c_string] keys, values
 * 
 */

static std::shared_ptr< arrow::KeyValueMetadata>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_metadata(PyObject *__pyx_v_meta) {
  std::vector<std::string>  __pyx_v_keys;
  std::vector<std::string>  __pyx_v_values;
  std::shared_ptr< arrow::KeyValueMetadata>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  std::vector<std::string>  __pyx_t_7;
  std::shared_ptr< arrow::KeyValueMetadata>  __pyx_t_8;
  __Pyx_RefNannySetupContext("pyarrow_unwrap_metadata", 0);

  /* "pyarrow/public-api.pxi":112
 *     cdef vector[c_string] keys, values
 * 
 *     if isinstance(meta, dict):             # <<<<<<<<<<<<<<
 *         keys = map(tobytes, meta.keys())
 *         values = map(tobytes, meta.values())
 */
  __pyx_t_1 = PyDict_Check(__pyx_v_meta); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/public-api.pxi":113
 * 
 *     if isinstance(meta, dict):
 *         keys = map(tobytes, meta.keys())             # <<<<<<<<<<<<<<
 *         values = map(tobytes, meta.values())
 *         return make_shared[CKeyValueMetadata](keys, values)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_meta, __pyx_n_s_keys); if (unlikely(!__pyx_t_5)) __PYX_ERR(16, 113, __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(16, 113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(16, 113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(16, 113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(16, 113, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_keys = __pyx_t_7;

    /* "pyarrow/public-api.pxi":114
 *     if isinstance(meta, dict):
 *         keys = map(tobytes, meta.keys())
 *         values = map(tobytes, meta.values())             # <<<<<<<<<<<<<<
 *         return make_shared[CKeyValueMetadata](keys, values)
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(16, 114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_meta, __pyx_n_s_values); if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(16, 114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(16, 114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(16, 114, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_values = __pyx_t_7;

    /* "pyarrow/public-api.pxi":115
 *         keys = map(tobytes, meta.keys())
 *         values = map(tobytes, meta.values())
 *         return make_shared[CKeyValueMetadata](keys, values)             # <<<<<<<<<<<<<<
 * 
 *     return shared_ptr[CKeyValueMetadata]()
 */
    try {
      __pyx_t_8 = std::make_shared< arrow::KeyValueMetadata>(__pyx_v_keys, __pyx_v_values);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(16, 115, __pyx_L1_error)
    }
    __pyx_r = __pyx_t_8;
    goto __pyx_L0;

    /* "pyarrow/public-api.pxi":112
 *     cdef vector[c_string] keys, values
 * 
 *     if isinstance(meta, dict):             # <<<<<<<<<<<<<<
 *         keys = map(tobytes, meta.keys())
 *         values = map(tobytes, meta.values())
 */
  }

  /* "pyarrow/public-api.pxi":117
 *         return make_shared[CKeyValueMetadata](keys, values)
 * 
 *     return shared_ptr[CKeyValueMetadata]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::KeyValueMetadata> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":109
 * 
 * 
 * cdef shared_ptr[CKeyValueMetadata] pyarrow_unwrap_metadata(object meta):             # <<<<<<<<<<<<<<
 *     cdef vector[c_string] keys, values
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("pyarrow.lib.pyarrow_unwrap_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":120
 * 
 * 
 * cdef api bint pyarrow_is_field(object field):             # <<<<<<<<<<<<<<
 *     return isinstance(field, Field)
 * 
 */

static int __pyx_f_7pyarrow_3lib_pyarrow_is_field(PyObject *__pyx_v_field) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("pyarrow_is_field", 0);

  /* "pyarrow/public-api.pxi":121
 * 
 * cdef api bint pyarrow_is_field(object field):
 *     return isinstance(field, Field)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_field, __pyx_ptype_7pyarrow_3lib_Field); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":120
 * 
 * 
 * cdef api bint pyarrow_is_field(object field):             # <<<<<<<<<<<<<<
 *     return isinstance(field, Field)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":124
 * 
 * 
 * cdef api shared_ptr[CField] pyarrow_unwrap_field(object field):             # <<<<<<<<<<<<<<
 *     cdef Field field_
 *     if pyarrow_is_field(field):
 */

std::shared_ptr< arrow::Field>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_field(PyObject *__pyx_v_field) {
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_field_ = 0;
  std::shared_ptr< arrow::Field>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_unwrap_field", 0);

  /* "pyarrow/public-api.pxi":126
 * cdef api shared_ptr[CField] pyarrow_unwrap_field(object field):
 *     cdef Field field_
 *     if pyarrow_is_field(field):             # <<<<<<<<<<<<<<
 *         field_ = <Field>(field)
 *         return field_.sp_field
 */
  __pyx_t_1 = (__pyx_f_7pyarrow_3lib_pyarrow_is_field(__pyx_v_field) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":127
 *     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":128
 *     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":126
 * cdef api shared_ptr[CField] pyarrow_unwrap_field(object field):
 *     cdef Field field_
 *     if pyarrow_is_field(field):             # <<<<<<<<<<<<<<
 *         field_ = <Field>(field)
 *         return field_.sp_field
 */
  }

  /* "pyarrow/public-api.pxi":130
 *         return field_.sp_field
 * 
 *     return shared_ptr[CField]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::Field> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":124
 * 
 * 
 * cdef api shared_ptr[CField] pyarrow_unwrap_field(object field):             # <<<<<<<<<<<<<<
 *     cdef Field field_
 *     if pyarrow_is_field(field):
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_field_);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":133
 * 
 * 
 * cdef api object pyarrow_wrap_field(const shared_ptr[CField]& field):             # <<<<<<<<<<<<<<
 *     if field.get() == NULL:
 *         return None
 */

PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_field(std::shared_ptr< arrow::Field>  const &__pyx_v_field) {
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_wrap_field", 0);

  /* "pyarrow/public-api.pxi":134
 * 
 * cdef api object pyarrow_wrap_field(const shared_ptr[CField]& field):
 *     if field.get() == NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     cdef Field out = Field.__new__(Field)
 */
  __pyx_t_1 = ((__pyx_v_field.get() == NULL) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":135
 * cdef api object pyarrow_wrap_field(const shared_ptr[CField]& field):
 *     if field.get() == NULL:
 *         return None             # <<<<<<<<<<<<<<
 *     cdef Field out = Field.__new__(Field)
 *     out.init(field)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/public-api.pxi":134
 * 
 * cdef api object pyarrow_wrap_field(const shared_ptr[CField]& field):
 *     if field.get() == NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     cdef Field out = Field.__new__(Field)
 */
  }

  /* "pyarrow/public-api.pxi":136
 *     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, 136, __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":137
 *         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":138
 *     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":133
 * 
 * 
 * cdef api object pyarrow_wrap_field(const shared_ptr[CField]& field):             # <<<<<<<<<<<<<<
 *     if field.get() == NULL:
 *         return None
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_field", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":141
 * 
 * 
 * cdef api bint pyarrow_is_schema(object schema):             # <<<<<<<<<<<<<<
 *     return isinstance(schema, Schema)
 * 
 */

static int __pyx_f_7pyarrow_3lib_pyarrow_is_schema(PyObject *__pyx_v_schema) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("pyarrow_is_schema", 0);

  /* "pyarrow/public-api.pxi":142
 * 
 * cdef api bint pyarrow_is_schema(object schema):
 *     return isinstance(schema, Schema)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_schema, __pyx_ptype_7pyarrow_3lib_Schema); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":141
 * 
 * 
 * cdef api bint pyarrow_is_schema(object schema):             # <<<<<<<<<<<<<<
 *     return isinstance(schema, Schema)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":145
 * 
 * 
 * cdef api shared_ptr[CSchema] pyarrow_unwrap_schema(object schema):             # <<<<<<<<<<<<<<
 *     cdef Schema sch
 *     if pyarrow_is_schema(schema):
 */

std::shared_ptr< arrow::Schema>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_schema(PyObject *__pyx_v_schema) {
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_sch = 0;
  std::shared_ptr< arrow::Schema>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_unwrap_schema", 0);

  /* "pyarrow/public-api.pxi":147
 * cdef api shared_ptr[CSchema] pyarrow_unwrap_schema(object schema):
 *     cdef Schema sch
 *     if pyarrow_is_schema(schema):             # <<<<<<<<<<<<<<
 *         sch = <Schema>(schema)
 *         return sch.sp_schema
 */
  __pyx_t_1 = (__pyx_f_7pyarrow_3lib_pyarrow_is_schema(__pyx_v_schema) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":148
 *     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":149
 *     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":147
 * cdef api shared_ptr[CSchema] pyarrow_unwrap_schema(object schema):
 *     cdef Schema sch
 *     if pyarrow_is_schema(schema):             # <<<<<<<<<<<<<<
 *         sch = <Schema>(schema)
 *         return sch.sp_schema
 */
  }

  /* "pyarrow/public-api.pxi":151
 *         return sch.sp_schema
 * 
 *     return shared_ptr[CSchema]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::Schema> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":145
 * 
 * 
 * cdef api shared_ptr[CSchema] pyarrow_unwrap_schema(object schema):             # <<<<<<<<<<<<<<
 *     cdef Schema sch
 *     if pyarrow_is_schema(schema):
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_sch);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":154
 * 
 * 
 * cdef api object pyarrow_wrap_schema(const shared_ptr[CSchema]& schema):             # <<<<<<<<<<<<<<
 *     cdef Schema out = Schema.__new__(Schema)
 *     out.init_schema(schema)
 */

PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(std::shared_ptr< arrow::Schema>  const &__pyx_v_schema) {
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_wrap_schema", 0);

  /* "pyarrow/public-api.pxi":155
 * 
 * cdef api object pyarrow_wrap_schema(const shared_ptr[CSchema]& schema):
 *     cdef Schema out = Schema.__new__(Schema)             # <<<<<<<<<<<<<<
 *     out.init_schema(schema)
 *     return out
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_Schema(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_Schema), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 155, __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":156
 * cdef api object pyarrow_wrap_schema(const shared_ptr[CSchema]& schema):
 *     cdef Schema out = Schema.__new__(Schema)
 *     out.init_schema(schema)             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_Schema *)__pyx_v_out->__pyx_vtab)->init_schema(__pyx_v_out, __pyx_v_schema);

  /* "pyarrow/public-api.pxi":157
 *     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":154
 * 
 * 
 * cdef api object pyarrow_wrap_schema(const shared_ptr[CSchema]& schema):             # <<<<<<<<<<<<<<
 *     cdef Schema out = Schema.__new__(Schema)
 *     out.init_schema(schema)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_schema", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":160
 * 
 * 
 * cdef api bint pyarrow_is_array(object array):             # <<<<<<<<<<<<<<
 *     return isinstance(array, Array)
 * 
 */

static int __pyx_f_7pyarrow_3lib_pyarrow_is_array(PyObject *__pyx_v_array) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("pyarrow_is_array", 0);

  /* "pyarrow/public-api.pxi":161
 * 
 * cdef api bint pyarrow_is_array(object array):
 *     return isinstance(array, Array)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_array, __pyx_ptype_7pyarrow_3lib_Array); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":160
 * 
 * 
 * cdef api bint pyarrow_is_array(object array):             # <<<<<<<<<<<<<<
 *     return isinstance(array, Array)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":164
 * 
 * 
 * cdef api shared_ptr[CArray] pyarrow_unwrap_array(object array):             # <<<<<<<<<<<<<<
 *     cdef Array arr
 *     if pyarrow_is_array(array):
 */

std::shared_ptr< arrow::Array>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_array(PyObject *__pyx_v_array) {
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_arr = 0;
  std::shared_ptr< arrow::Array>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_unwrap_array", 0);

  /* "pyarrow/public-api.pxi":166
 * cdef api shared_ptr[CArray] pyarrow_unwrap_array(object array):
 *     cdef Array arr
 *     if pyarrow_is_array(array):             # <<<<<<<<<<<<<<
 *         arr = <Array>(array)
 *         return arr.sp_array
 */
  __pyx_t_1 = (__pyx_f_7pyarrow_3lib_pyarrow_is_array(__pyx_v_array) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":167
 *     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":168
 *     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":166
 * cdef api shared_ptr[CArray] pyarrow_unwrap_array(object array):
 *     cdef Array arr
 *     if pyarrow_is_array(array):             # <<<<<<<<<<<<<<
 *         arr = <Array>(array)
 *         return arr.sp_array
 */
  }

  /* "pyarrow/public-api.pxi":170
 *         return arr.sp_array
 * 
 *     return shared_ptr[CArray]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::Array> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":164
 * 
 * 
 * cdef api shared_ptr[CArray] pyarrow_unwrap_array(object array):             # <<<<<<<<<<<<<<
 *     cdef Array arr
 *     if pyarrow_is_array(array):
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":173
 * 
 * 
 * cdef api object pyarrow_wrap_array(const shared_ptr[CArray]& sp_array):             # <<<<<<<<<<<<<<
 *     if sp_array.get() == NULL:
 *         raise ValueError('Array was NULL')
 */

PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_array(std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array) {
   arrow::DataType *__pyx_v_data_type;
  PyObject *__pyx_v_klass = NULL;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_arr = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_wrap_array", 0);

  /* "pyarrow/public-api.pxi":174
 * 
 * cdef api object pyarrow_wrap_array(const shared_ptr[CArray]& sp_array):
 *     if sp_array.get() == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('Array was NULL')
 * 
 */
  __pyx_t_1 = ((__pyx_v_sp_array.get() == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/public-api.pxi":175
 * cdef api object pyarrow_wrap_array(const shared_ptr[CArray]& sp_array):
 *     if sp_array.get() == NULL:
 *         raise ValueError('Array was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef CDataType* data_type = sp_array.get().type().get()
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__221, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 175, __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, 175, __pyx_L1_error)

    /* "pyarrow/public-api.pxi":174
 * 
 * cdef api object pyarrow_wrap_array(const shared_ptr[CArray]& sp_array):
 *     if sp_array.get() == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('Array was NULL')
 * 
 */
  }

  /* "pyarrow/public-api.pxi":177
 *         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":179
 *     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":180
 * 
 *     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__222, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 180, __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, 180, __pyx_L1_error)

    /* "pyarrow/public-api.pxi":179
 *     cdef CDataType* data_type = sp_array.get().type().get()
 * 
 *     if data_type == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('Array data type was NULL')
 * 
 */
  }

  /* "pyarrow/public-api.pxi":182
 *         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, 182, __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, 182, __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, 182, __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":184
 *     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, 184, __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, 184, __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, 184, __pyx_L1_error)
  __pyx_v_arr = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyarrow/public-api.pxi":185
 * 
 *     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":186
 *     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":173
 * 
 * 
 * cdef api object pyarrow_wrap_array(const shared_ptr[CArray]& sp_array):             # <<<<<<<<<<<<<<
 *     if sp_array.get() == NULL:
 *         raise ValueError('Array was NULL')
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_klass);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":189
 * 
 * 
 * cdef api object pyarrow_wrap_chunked_array(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CChunkedArray]& sp_array):
 *     if sp_array.get() == NULL:
 */

PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array(std::shared_ptr< arrow::ChunkedArray>  const &__pyx_v_sp_array) {
   arrow::DataType *__pyx_v_data_type;
  struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_arr = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_wrap_chunked_array", 0);

  /* "pyarrow/public-api.pxi":191
 * cdef api object pyarrow_wrap_chunked_array(
 *         const shared_ptr[CChunkedArray]& sp_array):
 *     if sp_array.get() == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('ChunkedArray was NULL')
 * 
 */
  __pyx_t_1 = ((__pyx_v_sp_array.get() == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/public-api.pxi":192
 *         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__223, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 192, __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, 192, __pyx_L1_error)

    /* "pyarrow/public-api.pxi":191
 * cdef api object pyarrow_wrap_chunked_array(
 *         const shared_ptr[CChunkedArray]& sp_array):
 *     if sp_array.get() == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('ChunkedArray was NULL')
 * 
 */
  }

  /* "pyarrow/public-api.pxi":194
 *         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":196
 *     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":197
 * 
 *     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__224, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 197, __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, 197, __pyx_L1_error)

    /* "pyarrow/public-api.pxi":196
 *     cdef CDataType* data_type = sp_array.get().type().get()
 * 
 *     if data_type == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('ChunkedArray data type was NULL')
 * 
 */
  }

  /* "pyarrow/public-api.pxi":199
 *         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, 199, __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":200
 * 
 *     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":201
 *     cdef ChunkedArray arr = ChunkedArray.__new__(ChunkedArray)
 *     arr.init(sp_array)
 *     return arr             # <<<<<<<<<<<<<<
 * 
 * cdef api object pyarrow_wrap_scalar(const shared_ptr[CScalar]& sp_scalar):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_arr));
  __pyx_r = ((PyObject *)__pyx_v_arr);
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":189
 * 
 * 
 * cdef api object pyarrow_wrap_chunked_array(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CChunkedArray]& sp_array):
 *     if sp_array.get() == NULL:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_chunked_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":203
 *     return arr
 * 
 * cdef api object pyarrow_wrap_scalar(const shared_ptr[CScalar]& sp_scalar):             # <<<<<<<<<<<<<<
 *     if sp_scalar.get() == NULL:
 *         raise ValueError('Scalar was NULL')
 */

static PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_scalar(std::shared_ptr< arrow::Scalar>  const &__pyx_v_sp_scalar) {
   arrow::DataType *__pyx_v_data_type;
  PyObject *__pyx_v_klass = NULL;
  struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_scalar = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_wrap_scalar", 0);

  /* "pyarrow/public-api.pxi":204
 * 
 * cdef api object pyarrow_wrap_scalar(const shared_ptr[CScalar]& sp_scalar):
 *     if sp_scalar.get() == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('Scalar was NULL')
 * 
 */
  __pyx_t_1 = ((__pyx_v_sp_scalar.get() == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/public-api.pxi":205
 * cdef api object pyarrow_wrap_scalar(const shared_ptr[CScalar]& sp_scalar):
 *     if sp_scalar.get() == NULL:
 *         raise ValueError('Scalar was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef CDataType* data_type = sp_scalar.get().type.get()
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__225, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 205, __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, 205, __pyx_L1_error)

    /* "pyarrow/public-api.pxi":204
 * 
 * cdef api object pyarrow_wrap_scalar(const shared_ptr[CScalar]& sp_scalar):
 *     if sp_scalar.get() == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('Scalar was NULL')
 * 
 */
  }

  /* "pyarrow/public-api.pxi":207
 *         raise ValueError('Scalar was NULL')
 * 
 *     cdef CDataType* data_type = sp_scalar.get().type.get()             # <<<<<<<<<<<<<<
 * 
 *     if data_type == NULL:
 */
  __pyx_v_data_type = __pyx_v_sp_scalar.get()->type.get();

  /* "pyarrow/public-api.pxi":209
 *     cdef CDataType* data_type = sp_scalar.get().type.get()
 * 
 *     if data_type == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('Scalar data type was NULL')
 * 
 */
  __pyx_t_1 = ((__pyx_v_data_type == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/public-api.pxi":210
 * 
 *     if data_type == NULL:
 *         raise ValueError('Scalar data type was NULL')             # <<<<<<<<<<<<<<
 * 
 *     klass = _scalar_classes[data_type.id()]
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__226, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 210, __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, 210, __pyx_L1_error)

    /* "pyarrow/public-api.pxi":209
 *     cdef CDataType* data_type = sp_scalar.get().type.get()
 * 
 *     if data_type == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('Scalar data type was NULL')
 * 
 */
  }

  /* "pyarrow/public-api.pxi":212
 *         raise ValueError('Scalar data type was NULL')
 * 
 *     klass = _scalar_classes[data_type.id()]             # <<<<<<<<<<<<<<
 * 
 *     cdef ScalarValue scalar = klass.__new__(klass)
 */
  if (unlikely(__pyx_v_7pyarrow_3lib__scalar_classes == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(16, 212, __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, 212, __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(16, 212, __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":214
 *     klass = _scalar_classes[data_type.id()]
 * 
 *     cdef ScalarValue scalar = klass.__new__(klass)             # <<<<<<<<<<<<<<
 *     scalar.init(sp_scalar)
 *     return scalar
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_klass, __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 214, __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, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_ScalarValue))))) __PYX_ERR(16, 214, __pyx_L1_error)
  __pyx_v_scalar = ((struct __pyx_obj_7pyarrow_3lib_ScalarValue *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyarrow/public-api.pxi":215
 * 
 *     cdef ScalarValue scalar = klass.__new__(klass)
 *     scalar.init(sp_scalar)             # <<<<<<<<<<<<<<
 *     return scalar
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue *)__pyx_v_scalar->__pyx_vtab)->init(__pyx_v_scalar, __pyx_v_sp_scalar);

  /* "pyarrow/public-api.pxi":216
 *     cdef ScalarValue scalar = klass.__new__(klass)
 *     scalar.init(sp_scalar)
 *     return scalar             # <<<<<<<<<<<<<<
 * 
 * cdef api bint pyarrow_is_tensor(object tensor):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_scalar));
  __pyx_r = ((PyObject *)__pyx_v_scalar);
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":203
 *     return arr
 * 
 * cdef api object pyarrow_wrap_scalar(const shared_ptr[CScalar]& sp_scalar):             # <<<<<<<<<<<<<<
 *     if sp_scalar.get() == NULL:
 *         raise ValueError('Scalar was NULL')
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_klass);
  __Pyx_XDECREF((PyObject *)__pyx_v_scalar);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":218
 *     return scalar
 * 
 * cdef api bint pyarrow_is_tensor(object tensor):             # <<<<<<<<<<<<<<
 *     return isinstance(tensor, Tensor)
 * 
 */

static int __pyx_f_7pyarrow_3lib_pyarrow_is_tensor(PyObject *__pyx_v_tensor) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("pyarrow_is_tensor", 0);

  /* "pyarrow/public-api.pxi":219
 * 
 * cdef api bint pyarrow_is_tensor(object tensor):
 *     return isinstance(tensor, Tensor)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_tensor, __pyx_ptype_7pyarrow_3lib_Tensor); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":218
 *     return scalar
 * 
 * cdef api bint pyarrow_is_tensor(object tensor):             # <<<<<<<<<<<<<<
 *     return isinstance(tensor, Tensor)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":222
 * 
 * 
 * cdef api shared_ptr[CTensor] pyarrow_unwrap_tensor(object tensor):             # <<<<<<<<<<<<<<
 *     cdef Tensor ten
 *     if pyarrow_is_tensor(tensor):
 */

std::shared_ptr< arrow::Tensor>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_tensor(PyObject *__pyx_v_tensor) {
  struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_ten = 0;
  std::shared_ptr< arrow::Tensor>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_unwrap_tensor", 0);

  /* "pyarrow/public-api.pxi":224
 * cdef api shared_ptr[CTensor] pyarrow_unwrap_tensor(object tensor):
 *     cdef Tensor ten
 *     if pyarrow_is_tensor(tensor):             # <<<<<<<<<<<<<<
 *         ten = <Tensor>(tensor)
 *         return ten.sp_tensor
 */
  __pyx_t_1 = (__pyx_f_7pyarrow_3lib_pyarrow_is_tensor(__pyx_v_tensor) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":225
 *     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":226
 *     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":224
 * cdef api shared_ptr[CTensor] pyarrow_unwrap_tensor(object tensor):
 *     cdef Tensor ten
 *     if pyarrow_is_tensor(tensor):             # <<<<<<<<<<<<<<
 *         ten = <Tensor>(tensor)
 *         return ten.sp_tensor
 */
  }

  /* "pyarrow/public-api.pxi":228
 *         return ten.sp_tensor
 * 
 *     return shared_ptr[CTensor]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::Tensor> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":222
 * 
 * 
 * cdef api shared_ptr[CTensor] pyarrow_unwrap_tensor(object tensor):             # <<<<<<<<<<<<<<
 *     cdef Tensor ten
 *     if pyarrow_is_tensor(tensor):
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ten);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":231
 * 
 * 
 * cdef api object pyarrow_wrap_tensor(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CTensor]& sp_tensor):
 *     if sp_tensor.get() == NULL:
 */

PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_tensor(std::shared_ptr< arrow::Tensor>  const &__pyx_v_sp_tensor) {
  struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_tensor = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_wrap_tensor", 0);

  /* "pyarrow/public-api.pxi":233
 * cdef api object pyarrow_wrap_tensor(
 *         const shared_ptr[CTensor]& sp_tensor):
 *     if sp_tensor.get() == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('Tensor was NULL')
 * 
 */
  __pyx_t_1 = ((__pyx_v_sp_tensor.get() == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/public-api.pxi":234
 *         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__227, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 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(16, 234, __pyx_L1_error)

    /* "pyarrow/public-api.pxi":233
 * cdef api object pyarrow_wrap_tensor(
 *         const shared_ptr[CTensor]& sp_tensor):
 *     if sp_tensor.get() == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('Tensor was NULL')
 * 
 */
  }

  /* "pyarrow/public-api.pxi":236
 *         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, 236, __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":237
 * 
 *     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":238
 *     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":231
 * 
 * 
 * cdef api object pyarrow_wrap_tensor(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CTensor]& sp_tensor):
 *     if sp_tensor.get() == NULL:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_tensor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_tensor);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":241
 * 
 * 
 * cdef api bint pyarrow_is_column(object column):             # <<<<<<<<<<<<<<
 *     return isinstance(column, Column)
 * 
 */

static int __pyx_f_7pyarrow_3lib_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":242
 * 
 * cdef 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":241
 * 
 * 
 * cdef 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":245
 * 
 * 
 * cdef 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":247
 * cdef 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 = (__pyx_f_7pyarrow_3lib_pyarrow_is_column(__pyx_v_column) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":248
 *     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":249
 *     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":247
 * cdef 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":251
 *         return col.sp_column
 * 
 *     return shared_ptr[CColumn]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::Column> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":245
 * 
 * 
 * cdef 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":254
 * 
 * 
 * cdef 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":255
 * 
 * cdef 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, 255, __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":256
 * cdef 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":257
 *     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":254
 * 
 * 
 * cdef 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":260
 * 
 * 
 * cdef api bint pyarrow_is_table(object table):             # <<<<<<<<<<<<<<
 *     return isinstance(table, Table)
 * 
 */

static int __pyx_f_7pyarrow_3lib_pyarrow_is_table(PyObject *__pyx_v_table) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("pyarrow_is_table", 0);

  /* "pyarrow/public-api.pxi":261
 * 
 * cdef api bint pyarrow_is_table(object table):
 *     return isinstance(table, Table)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_table, __pyx_ptype_7pyarrow_3lib_Table); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":260
 * 
 * 
 * cdef api bint pyarrow_is_table(object table):             # <<<<<<<<<<<<<<
 *     return isinstance(table, Table)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":264
 * 
 * 
 * cdef api shared_ptr[CTable] pyarrow_unwrap_table(object table):             # <<<<<<<<<<<<<<
 *     cdef Table tab
 *     if pyarrow_is_table(table):
 */

std::shared_ptr< arrow::Table>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_table(PyObject *__pyx_v_table) {
  struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_tab = 0;
  std::shared_ptr< arrow::Table>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_unwrap_table", 0);

  /* "pyarrow/public-api.pxi":266
 * cdef api shared_ptr[CTable] pyarrow_unwrap_table(object table):
 *     cdef Table tab
 *     if pyarrow_is_table(table):             # <<<<<<<<<<<<<<
 *         tab = <Table>(table)
 *         return tab.sp_table
 */
  __pyx_t_1 = (__pyx_f_7pyarrow_3lib_pyarrow_is_table(__pyx_v_table) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":267
 *     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":268
 *     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":266
 * cdef api shared_ptr[CTable] pyarrow_unwrap_table(object table):
 *     cdef Table tab
 *     if pyarrow_is_table(table):             # <<<<<<<<<<<<<<
 *         tab = <Table>(table)
 *         return tab.sp_table
 */
  }

  /* "pyarrow/public-api.pxi":270
 *         return tab.sp_table
 * 
 *     return shared_ptr[CTable]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::Table> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":264
 * 
 * 
 * cdef api shared_ptr[CTable] pyarrow_unwrap_table(object table):             # <<<<<<<<<<<<<<
 *     cdef Table tab
 *     if pyarrow_is_table(table):
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_tab);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":273
 * 
 * 
 * cdef api object pyarrow_wrap_table(const shared_ptr[CTable]& ctable):             # <<<<<<<<<<<<<<
 *     # Ensure that wrapped table is Valid
 *     check_status(ctable.get().Validate())
 */

PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_table(std::shared_ptr< arrow::Table>  const &__pyx_v_ctable) {
  struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_table = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_wrap_table", 0);

  /* "pyarrow/public-api.pxi":275
 * cdef api object pyarrow_wrap_table(const shared_ptr[CTable]& ctable):
 *     # Ensure that wrapped table is Valid
 *     check_status(ctable.get().Validate())             # <<<<<<<<<<<<<<
 *     cdef Table table = Table.__new__(Table)
 *     table.init(ctable)
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_ctable.get()->Validate()); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(16, 275, __pyx_L1_error)

  /* "pyarrow/public-api.pxi":276
 *     # Ensure that wrapped table is Valid
 *     check_status(ctable.get().Validate())
 *     cdef Table table = Table.__new__(Table)             # <<<<<<<<<<<<<<
 *     table.init(ctable)
 *     return table
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_Table(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_Table), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 276, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_table = ((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/public-api.pxi":277
 *     check_status(ctable.get().Validate())
 *     cdef Table table = Table.__new__(Table)
 *     table.init(ctable)             # <<<<<<<<<<<<<<
 *     return table
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_Table *)__pyx_v_table->__pyx_vtab)->init(__pyx_v_table, __pyx_v_ctable);

  /* "pyarrow/public-api.pxi":278
 *     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":273
 * 
 * 
 * cdef api object pyarrow_wrap_table(const shared_ptr[CTable]& ctable):             # <<<<<<<<<<<<<<
 *     # Ensure that wrapped table is Valid
 *     check_status(ctable.get().Validate())
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_table);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":281
 * 
 * 
 * cdef api bint pyarrow_is_batch(object batch):             # <<<<<<<<<<<<<<
 *     return isinstance(batch, RecordBatch)
 * 
 */

static int __pyx_f_7pyarrow_3lib_pyarrow_is_batch(PyObject *__pyx_v_batch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("pyarrow_is_batch", 0);

  /* "pyarrow/public-api.pxi":282
 * 
 * cdef api bint pyarrow_is_batch(object batch):
 *     return isinstance(batch, RecordBatch)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_batch, __pyx_ptype_7pyarrow_3lib_RecordBatch); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":281
 * 
 * 
 * cdef api bint pyarrow_is_batch(object batch):             # <<<<<<<<<<<<<<
 *     return isinstance(batch, RecordBatch)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":285
 * 
 * 
 * cdef api shared_ptr[CRecordBatch] pyarrow_unwrap_batch(object batch):             # <<<<<<<<<<<<<<
 *     cdef RecordBatch bat
 *     if pyarrow_is_batch(batch):
 */

std::shared_ptr< arrow::RecordBatch>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_batch(PyObject *__pyx_v_batch) {
  struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_bat = 0;
  std::shared_ptr< arrow::RecordBatch>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_unwrap_batch", 0);

  /* "pyarrow/public-api.pxi":287
 * cdef api shared_ptr[CRecordBatch] pyarrow_unwrap_batch(object batch):
 *     cdef RecordBatch bat
 *     if pyarrow_is_batch(batch):             # <<<<<<<<<<<<<<
 *         bat = <RecordBatch>(batch)
 *         return bat.sp_batch
 */
  __pyx_t_1 = (__pyx_f_7pyarrow_3lib_pyarrow_is_batch(__pyx_v_batch) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":288
 *     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":289
 *     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":287
 * cdef api shared_ptr[CRecordBatch] pyarrow_unwrap_batch(object batch):
 *     cdef RecordBatch bat
 *     if pyarrow_is_batch(batch):             # <<<<<<<<<<<<<<
 *         bat = <RecordBatch>(batch)
 *         return bat.sp_batch
 */
  }

  /* "pyarrow/public-api.pxi":291
 *         return bat.sp_batch
 * 
 *     return shared_ptr[CRecordBatch]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::RecordBatch> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":285
 * 
 * 
 * cdef api shared_ptr[CRecordBatch] pyarrow_unwrap_batch(object batch):             # <<<<<<<<<<<<<<
 *     cdef RecordBatch bat
 *     if pyarrow_is_batch(batch):
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_bat);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":294
 * 
 * 
 * cdef api object pyarrow_wrap_batch(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CRecordBatch]& cbatch):
 *     cdef RecordBatch batch = RecordBatch.__new__(RecordBatch)
 */

PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_batch(std::shared_ptr< arrow::RecordBatch>  const &__pyx_v_cbatch) {
  struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_batch = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_wrap_batch", 0);

  /* "pyarrow/public-api.pxi":296
 * cdef api object pyarrow_wrap_batch(
 *         const shared_ptr[CRecordBatch]& cbatch):
 *     cdef RecordBatch batch = RecordBatch.__new__(RecordBatch)             # <<<<<<<<<<<<<<
 *     batch.init(cbatch)
 *     return batch
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_RecordBatch(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_RecordBatch), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 296, __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":297
 *         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":298
 *     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":294
 * 
 * 
 * cdef api object pyarrow_wrap_batch(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CRecordBatch]& cbatch):
 *     cdef RecordBatch batch = RecordBatch.__new__(RecordBatch)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_batch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_batch);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle__PandasAPIShim(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_171__pyx_unpickle__PandasAPIShim(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_170__pyx_unpickle__PandasAPIShim[] = "__pyx_unpickle__PandasAPIShim(__pyx_type, long __pyx_checksum, __pyx_state)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_171__pyx_unpickle__PandasAPIShim = {"__pyx_unpickle__PandasAPIShim", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_171__pyx_unpickle__PandasAPIShim, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_170__pyx_unpickle__PandasAPIShim};
static PyObject *__pyx_pw_7pyarrow_3lib_171__pyx_unpickle__PandasAPIShim(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle__PandasAPIShim (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__PandasAPIShim", 1, 3, 3, 1); __PYX_ERR(9, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__PandasAPIShim", 1, 3, 3, 2); __PYX_ERR(9, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle__PandasAPIShim") < 0)) __PYX_ERR(9, 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(9, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__PandasAPIShim", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.__pyx_unpickle__PandasAPIShim", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_170__pyx_unpickle__PandasAPIShim(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_170__pyx_unpickle__PandasAPIShim(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__pyx_unpickle__PandasAPIShim", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x019bb17:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x019bb17 = (_array_like_types, _categorical_type, _compat_module, _data_frame, _datetimetz_type, _have_pandas, _index, _loose_version, _pd, _series, _tried_importing_pandas, _types_api, _version))" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x019bb17) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x019bb17:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x019bb17 = (_array_like_types, _categorical_type, _compat_module, _data_frame, _datetimetz_type, _have_pandas, _index, _loose_version, _pd, _series, _tried_importing_pandas, _types_api, _version))" % __pyx_checksum)
 *     __pyx_result = _PandasAPIShim.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0x019bb17:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x019bb17 = (_array_like_types, _categorical_type, _compat_module, _data_frame, _datetimetz_type, _have_pandas, _index, _loose_version, _pd, _series, _tried_importing_pandas, _types_api, _version))" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = _PandasAPIShim.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x01, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(9, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x019bb17:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x019bb17 = (_array_like_types, _categorical_type, _compat_module, _data_frame, _datetimetz_type, _have_pandas, _index, _loose_version, _pd, _series, _tried_importing_pandas, _types_api, _version))" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x019bb17 = (_array_like_types, _categorical_type, _compat_module, _data_frame, _datetimetz_type, _have_pandas, _index, _loose_version, _pd, _series, _tried_importing_pandas, _types_api, _version))" % __pyx_checksum)
 *     __pyx_result = _PandasAPIShim.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle__PandasAPIShim__set_state(<_PandasAPIShim> __pyx_result, __pyx_state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib__PandasAPIShim), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x019bb17 = (_array_like_types, _categorical_type, _compat_module, _data_frame, _datetimetz_type, _have_pandas, _index, _loose_version, _pd, _series, _tried_importing_pandas, _types_api, _version))" % __pyx_checksum)
 *     __pyx_result = _PandasAPIShim.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle__PandasAPIShim__set_state(<_PandasAPIShim> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":9
 *     __pyx_result = _PandasAPIShim.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle__PandasAPIShim__set_state(<_PandasAPIShim> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle__PandasAPIShim__set_state(_PandasAPIShim __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(9, 9, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_7pyarrow_3lib___pyx_unpickle__PandasAPIShim__set_state(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x019bb17 = (_array_like_types, _categorical_type, _compat_module, _data_frame, _datetimetz_type, _have_pandas, _index, _loose_version, _pd, _series, _tried_importing_pandas, _types_api, _version))" % __pyx_checksum)
 *     __pyx_result = _PandasAPIShim.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle__PandasAPIShim__set_state(<_PandasAPIShim> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle__PandasAPIShim__set_state(<_PandasAPIShim> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle__PandasAPIShim__set_state(_PandasAPIShim __pyx_result, tuple __pyx_state):
 *     __pyx_result._array_like_types = __pyx_state[0]; __pyx_result._categorical_type = __pyx_state[1]; __pyx_result._compat_module = __pyx_state[2]; __pyx_result._data_frame = __pyx_state[3]; __pyx_result._datetimetz_type = __pyx_state[4]; __pyx_result._have_pandas = __pyx_state[5]; __pyx_result._index = __pyx_state[6]; __pyx_result._loose_version = __pyx_state[7]; __pyx_result._pd = __pyx_state[8]; __pyx_result._series = __pyx_state[9]; __pyx_result._tried_importing_pandas = __pyx_state[10]; __pyx_result._types_api = __pyx_state[11]; __pyx_result._version = __pyx_state[12]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle__PandasAPIShim(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.__pyx_unpickle__PandasAPIShim", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle__PandasAPIShim__set_state(<_PandasAPIShim> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle__PandasAPIShim__set_state(_PandasAPIShim __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result._array_like_types = __pyx_state[0]; __pyx_result._categorical_type = __pyx_state[1]; __pyx_result._compat_module = __pyx_state[2]; __pyx_result._data_frame = __pyx_state[3]; __pyx_result._datetimetz_type = __pyx_state[4]; __pyx_result._have_pandas = __pyx_state[5]; __pyx_result._index = __pyx_state[6]; __pyx_result._loose_version = __pyx_state[7]; __pyx_result._pd = __pyx_state[8]; __pyx_result._series = __pyx_state[9]; __pyx_result._tried_importing_pandas = __pyx_state[10]; __pyx_result._types_api = __pyx_state[11]; __pyx_result._version = __pyx_state[12]
 *     if len(__pyx_state) > 13 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_7pyarrow_3lib___pyx_unpickle__PandasAPIShim__set_state(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__pyx_unpickle__PandasAPIShim__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle__PandasAPIShim__set_state(_PandasAPIShim __pyx_result, tuple __pyx_state):
 *     __pyx_result._array_like_types = __pyx_state[0]; __pyx_result._categorical_type = __pyx_state[1]; __pyx_result._compat_module = __pyx_state[2]; __pyx_result._data_frame = __pyx_state[3]; __pyx_result._datetimetz_type = __pyx_state[4]; __pyx_result._have_pandas = __pyx_state[5]; __pyx_result._index = __pyx_state[6]; __pyx_result._loose_version = __pyx_state[7]; __pyx_result._pd = __pyx_state[8]; __pyx_result._series = __pyx_state[9]; __pyx_result._tried_importing_pandas = __pyx_state[10]; __pyx_result._types_api = __pyx_state[11]; __pyx_result._version = __pyx_state[12]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 13 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[13])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_array_like_types);
  __Pyx_DECREF(__pyx_v___pyx_result->_array_like_types);
  __pyx_v___pyx_result->_array_like_types = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_categorical_type);
  __Pyx_DECREF(__pyx_v___pyx_result->_categorical_type);
  __pyx_v___pyx_result->_categorical_type = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_compat_module);
  __Pyx_DECREF(__pyx_v___pyx_result->_compat_module);
  __pyx_v___pyx_result->_compat_module = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_data_frame);
  __Pyx_DECREF(__pyx_v___pyx_result->_data_frame);
  __pyx_v___pyx_result->_data_frame = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_datetimetz_type);
  __Pyx_DECREF(__pyx_v___pyx_result->_datetimetz_type);
  __pyx_v___pyx_result->_datetimetz_type = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->_have_pandas = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_index);
  __Pyx_DECREF(__pyx_v___pyx_result->_index);
  __pyx_v___pyx_result->_index = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_loose_version);
  __Pyx_DECREF(__pyx_v___pyx_result->_loose_version);
  __pyx_v___pyx_result->_loose_version = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_pd);
  __Pyx_DECREF(__pyx_v___pyx_result->_pd);
  __pyx_v___pyx_result->_pd = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_series);
  __Pyx_DECREF(__pyx_v___pyx_result->_series);
  __pyx_v___pyx_result->_series = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->_tried_importing_pandas = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_types_api);
  __Pyx_DECREF(__pyx_v___pyx_result->_types_api);
  __pyx_v___pyx_result->_types_api = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_version);
  __Pyx_DECREF(__pyx_v___pyx_result->_version);
  __pyx_v___pyx_result->_version = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle__PandasAPIShim__set_state(_PandasAPIShim __pyx_result, tuple __pyx_state):
 *     __pyx_result._array_like_types = __pyx_state[0]; __pyx_result._categorical_type = __pyx_state[1]; __pyx_result._compat_module = __pyx_state[2]; __pyx_result._data_frame = __pyx_state[3]; __pyx_result._datetimetz_type = __pyx_state[4]; __pyx_result._have_pandas = __pyx_state[5]; __pyx_result._index = __pyx_state[6]; __pyx_result._loose_version = __pyx_state[7]; __pyx_result._pd = __pyx_state[8]; __pyx_result._series = __pyx_state[9]; __pyx_result._tried_importing_pandas = __pyx_state[10]; __pyx_result._types_api = __pyx_state[11]; __pyx_result._version = __pyx_state[12]
 *     if len(__pyx_state) > 13 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[13])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(9, 13, __pyx_L1_error)
  }
  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(9, 13, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 > 13) != 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(9, 13, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_4 != 0);
  __pyx_t_2 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":14
 *     __pyx_result._array_like_types = __pyx_state[0]; __pyx_result._categorical_type = __pyx_state[1]; __pyx_result._compat_module = __pyx_state[2]; __pyx_result._data_frame = __pyx_state[3]; __pyx_result._datetimetz_type = __pyx_state[4]; __pyx_result._have_pandas = __pyx_state[5]; __pyx_result._index = __pyx_state[6]; __pyx_result._loose_version = __pyx_state[7]; __pyx_result._pd = __pyx_state[8]; __pyx_result._series = __pyx_state[9]; __pyx_result._tried_importing_pandas = __pyx_state[10]; __pyx_result._types_api = __pyx_state[11]; __pyx_result._version = __pyx_state[12]
 *     if len(__pyx_state) > 13 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[13])             # <<<<<<<<<<<<<<
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(9, 14, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle__PandasAPIShim__set_state(_PandasAPIShim __pyx_result, tuple __pyx_state):
 *     __pyx_result._array_like_types = __pyx_state[0]; __pyx_result._categorical_type = __pyx_state[1]; __pyx_result._compat_module = __pyx_state[2]; __pyx_result._data_frame = __pyx_state[3]; __pyx_result._datetimetz_type = __pyx_state[4]; __pyx_result._have_pandas = __pyx_state[5]; __pyx_result._index = __pyx_state[6]; __pyx_result._loose_version = __pyx_state[7]; __pyx_result._pd = __pyx_state[8]; __pyx_result._series = __pyx_state[9]; __pyx_result._tried_importing_pandas = __pyx_state[10]; __pyx_result._types_api = __pyx_state[11]; __pyx_result._version = __pyx_state[12]
 *     if len(__pyx_state) > 13 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[13])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle__PandasAPIShim__set_state(<_PandasAPIShim> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle__PandasAPIShim__set_state(_PandasAPIShim __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result._array_like_types = __pyx_state[0]; __pyx_result._categorical_type = __pyx_state[1]; __pyx_result._compat_module = __pyx_state[2]; __pyx_result._data_frame = __pyx_state[3]; __pyx_result._datetimetz_type = __pyx_state[4]; __pyx_result._have_pandas = __pyx_state[5]; __pyx_result._index = __pyx_state[6]; __pyx_result._loose_version = __pyx_state[7]; __pyx_result._pd = __pyx_state[8]; __pyx_result._series = __pyx_state[9]; __pyx_result._tried_importing_pandas = __pyx_state[10]; __pyx_result._types_api = __pyx_state[11]; __pyx_result._version = __pyx_state[12]
 *     if len(__pyx_state) > 13 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.__pyx_unpickle__PandasAPIShim__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_Scalar(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_173__pyx_unpickle_Scalar(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_172__pyx_unpickle_Scalar[] = "__pyx_unpickle_Scalar(__pyx_type, long __pyx_checksum, __pyx_state)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_173__pyx_unpickle_Scalar = {"__pyx_unpickle_Scalar", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_173__pyx_unpickle_Scalar, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_172__pyx_unpickle_Scalar};
static PyObject *__pyx_pw_7pyarrow_3lib_173__pyx_unpickle_Scalar(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_Scalar (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Scalar", 1, 3, 3, 1); __PYX_ERR(9, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Scalar", 1, 3, 3, 2); __PYX_ERR(9, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Scalar") < 0)) __PYX_ERR(9, 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(9, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Scalar", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.__pyx_unpickle_Scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_172__pyx_unpickle_Scalar(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_172__pyx_unpickle_Scalar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__pyx_unpickle_Scalar", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x599dcce:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x599dcce = (type))" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x599dcce) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x599dcce:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x599dcce = (type))" % __pyx_checksum)
 *     __pyx_result = Scalar.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0x599dcce:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x599dcce = (type))" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = Scalar.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x59, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(9, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x599dcce:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x599dcce = (type))" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x599dcce = (type))" % __pyx_checksum)
 *     __pyx_result = Scalar.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Scalar__set_state(<Scalar> __pyx_result, __pyx_state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x599dcce = (type))" % __pyx_checksum)
 *     __pyx_result = Scalar.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Scalar__set_state(<Scalar> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":9
 *     __pyx_result = Scalar.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Scalar__set_state(<Scalar> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_Scalar__set_state(Scalar __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(9, 9, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_7pyarrow_3lib___pyx_unpickle_Scalar__set_state(((struct __pyx_obj_7pyarrow_3lib_Scalar *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x599dcce = (type))" % __pyx_checksum)
 *     __pyx_result = Scalar.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Scalar__set_state(<Scalar> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Scalar__set_state(<Scalar> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_Scalar__set_state(Scalar __pyx_result, tuple __pyx_state):
 *     __pyx_result.type = __pyx_state[0]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_Scalar(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.__pyx_unpickle_Scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_Scalar__set_state(<Scalar> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Scalar__set_state(Scalar __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.type = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_7pyarrow_3lib___pyx_unpickle_Scalar__set_state(struct __pyx_obj_7pyarrow_3lib_Scalar *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__pyx_unpickle_Scalar__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_Scalar__set_state(Scalar __pyx_result, tuple __pyx_state):
 *     __pyx_result.type = __pyx_state[0]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[1])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->type);
  __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->type));
  __pyx_v___pyx_result->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_Scalar__set_state(Scalar __pyx_result, tuple __pyx_state):
 *     __pyx_result.type = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[1])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(9, 13, __pyx_L1_error)
  }
  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(9, 13, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(9, 13, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_4 != 0);
  __pyx_t_2 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":14
 *     __pyx_result.type = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[1])             # <<<<<<<<<<<<<<
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(9, 14, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_Scalar__set_state(Scalar __pyx_result, tuple __pyx_state):
 *     __pyx_result.type = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[1])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_Scalar__set_state(<Scalar> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Scalar__set_state(Scalar __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.type = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.__pyx_unpickle_Scalar__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle__PandasConvertible(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_175__pyx_unpickle__PandasConvertible(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_174__pyx_unpickle__PandasConvertible[] = "__pyx_unpickle__PandasConvertible(__pyx_type, long __pyx_checksum, __pyx_state)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_175__pyx_unpickle__PandasConvertible = {"__pyx_unpickle__PandasConvertible", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_175__pyx_unpickle__PandasConvertible, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_174__pyx_unpickle__PandasConvertible};
static PyObject *__pyx_pw_7pyarrow_3lib_175__pyx_unpickle__PandasConvertible(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle__PandasConvertible (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__PandasConvertible", 1, 3, 3, 1); __PYX_ERR(9, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__PandasConvertible", 1, 3, 3, 2); __PYX_ERR(9, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle__PandasConvertible") < 0)) __PYX_ERR(9, 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(9, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__PandasConvertible", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.__pyx_unpickle__PandasConvertible", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_174__pyx_unpickle__PandasConvertible(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_174__pyx_unpickle__PandasConvertible(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__pyx_unpickle__PandasConvertible", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xd41d8cd:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xd41d8cd) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xd41d8cd:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
 *     __pyx_result = _PandasConvertible.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0xd41d8cd:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = _PandasConvertible.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xd4, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(9, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xd41d8cd:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
 *     __pyx_result = _PandasConvertible.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle__PandasConvertible__set_state(<_PandasConvertible> __pyx_result, __pyx_state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib__PandasConvertible), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
 *     __pyx_result = _PandasConvertible.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle__PandasConvertible__set_state(<_PandasConvertible> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":9
 *     __pyx_result = _PandasConvertible.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle__PandasConvertible__set_state(<_PandasConvertible> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle__PandasConvertible__set_state(_PandasConvertible __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(9, 9, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_7pyarrow_3lib___pyx_unpickle__PandasConvertible__set_state(((struct __pyx_obj_7pyarrow_3lib__PandasConvertible *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
 *     __pyx_result = _PandasConvertible.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle__PandasConvertible__set_state(<_PandasConvertible> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle__PandasConvertible__set_state(<_PandasConvertible> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle__PandasConvertible__set_state(_PandasConvertible __pyx_result, tuple __pyx_state):
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle__PandasConvertible(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.__pyx_unpickle__PandasConvertible", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle__PandasConvertible__set_state(<_PandasConvertible> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle__PandasConvertible__set_state(_PandasConvertible __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[0])
 */

static PyObject *__pyx_f_7pyarrow_3lib___pyx_unpickle__PandasConvertible__set_state(struct __pyx_obj_7pyarrow_3lib__PandasConvertible *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__pyx_unpickle__PandasConvertible__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle__PandasConvertible__set_state(_PandasConvertible __pyx_result, tuple __pyx_state):
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[0])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_2 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(9, 12, __pyx_L1_error)
  __pyx_t_3 = ((__pyx_t_2 > 0) != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(9, 12, __pyx_L1_error)
  __pyx_t_4 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "(tree fragment)":13
 * cdef __pyx_unpickle__PandasConvertible__set_state(_PandasConvertible __pyx_result, tuple __pyx_state):
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[0])             # <<<<<<<<<<<<<<
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(9, 13, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle__PandasConvertible__set_state(_PandasConvertible __pyx_result, tuple __pyx_state):
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[0])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle__PandasConvertible__set_state(<_PandasConvertible> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle__PandasConvertible__set_state(_PandasConvertible __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[0])
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.__pyx_unpickle__PandasConvertible__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_SerializationContext(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_177__pyx_unpickle_SerializationContext(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_176__pyx_unpickle_SerializationContext[] = "__pyx_unpickle_SerializationContext(__pyx_type, long __pyx_checksum, __pyx_state)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_177__pyx_unpickle_SerializationContext = {"__pyx_unpickle_SerializationContext", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_177__pyx_unpickle_SerializationContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_176__pyx_unpickle_SerializationContext};
static PyObject *__pyx_pw_7pyarrow_3lib_177__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(9, 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(9, 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(9, 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(9, 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(9, 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_176__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_176__pyx_unpickle_SerializationContext(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__pyx_unpickle_SerializationContext", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x9aeed6f:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x9aeed6f = (custom_deserializers, custom_serializers, pickle_deserializer, pickle_serializer, type_to_type_id, types_to_pickle, whitelisted_types))" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x9aeed6f) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x9aeed6f:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x9aeed6f = (custom_deserializers, custom_serializers, pickle_deserializer, pickle_serializer, type_to_type_id, types_to_pickle, whitelisted_types))" % __pyx_checksum)
 *     __pyx_result = SerializationContext.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0x9aeed6f:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x9aeed6f = (custom_deserializers, custom_serializers, pickle_deserializer, pickle_serializer, type_to_type_id, types_to_pickle, whitelisted_types))" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = SerializationContext.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x9a, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(9, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x9aeed6f:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x9aeed6f = (custom_deserializers, custom_serializers, pickle_deserializer, pickle_serializer, type_to_type_id, types_to_pickle, whitelisted_types))" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x9aeed6f = (custom_deserializers, custom_serializers, pickle_deserializer, pickle_serializer, type_to_type_id, types_to_pickle, whitelisted_types))" % __pyx_checksum)
 *     __pyx_result = SerializationContext.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_SerializationContext__set_state(<SerializationContext> __pyx_result, __pyx_state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_SerializationContext), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x9aeed6f = (custom_deserializers, custom_serializers, pickle_deserializer, pickle_serializer, type_to_type_id, types_to_pickle, whitelisted_types))" % __pyx_checksum)
 *     __pyx_result = SerializationContext.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_SerializationContext__set_state(<SerializationContext> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":9
 *     __pyx_result = SerializationContext.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_SerializationContext__set_state(<SerializationContext> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_SerializationContext__set_state(SerializationContext __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(9, 9, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_7pyarrow_3lib___pyx_unpickle_SerializationContext__set_state(((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x9aeed6f = (custom_deserializers, custom_serializers, pickle_deserializer, pickle_serializer, type_to_type_id, types_to_pickle, whitelisted_types))" % __pyx_checksum)
 *     __pyx_result = SerializationContext.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_SerializationContext__set_state(<SerializationContext> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_SerializationContext__set_state(<SerializationContext> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_SerializationContext__set_state(SerializationContext __pyx_result, tuple __pyx_state):
 *     __pyx_result.custom_deserializers = __pyx_state[0]; __pyx_result.custom_serializers = __pyx_state[1]; __pyx_result.pickle_deserializer = __pyx_state[2]; __pyx_result.pickle_serializer = __pyx_state[3]; __pyx_result.type_to_type_id = __pyx_state[4]; __pyx_result.types_to_pickle = __pyx_state[5]; __pyx_result.whitelisted_types = __pyx_state[6]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_SerializationContext(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.__pyx_unpickle_SerializationContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_SerializationContext__set_state(<SerializationContext> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_SerializationContext__set_state(SerializationContext __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.custom_deserializers = __pyx_state[0]; __pyx_result.custom_serializers = __pyx_state[1]; __pyx_result.pickle_deserializer = __pyx_state[2]; __pyx_result.pickle_serializer = __pyx_state[3]; __pyx_result.type_to_type_id = __pyx_state[4]; __pyx_result.types_to_pickle = __pyx_state[5]; __pyx_result.whitelisted_types = __pyx_state[6]
 *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_7pyarrow_3lib___pyx_unpickle_SerializationContext__set_state(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__pyx_unpickle_SerializationContext__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_SerializationContext__set_state(SerializationContext __pyx_result, tuple __pyx_state):
 *     __pyx_result.custom_deserializers = __pyx_state[0]; __pyx_result.custom_serializers = __pyx_state[1]; __pyx_result.pickle_deserializer = __pyx_state[2]; __pyx_result.pickle_serializer = __pyx_state[3]; __pyx_result.type_to_type_id = __pyx_state[4]; __pyx_result.types_to_pickle = __pyx_state[5]; __pyx_result.whitelisted_types = __pyx_state[6]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[7])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->custom_deserializers);
  __Pyx_DECREF(__pyx_v___pyx_result->custom_deserializers);
  __pyx_v___pyx_result->custom_deserializers = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->custom_serializers);
  __Pyx_DECREF(__pyx_v___pyx_result->custom_serializers);
  __pyx_v___pyx_result->custom_serializers = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->pickle_deserializer);
  __Pyx_DECREF(__pyx_v___pyx_result->pickle_deserializer);
  __pyx_v___pyx_result->pickle_deserializer = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->pickle_serializer);
  __Pyx_DECREF(__pyx_v___pyx_result->pickle_serializer);
  __pyx_v___pyx_result->pickle_serializer = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->type_to_type_id);
  __Pyx_DECREF(__pyx_v___pyx_result->type_to_type_id);
  __pyx_v___pyx_result->type_to_type_id = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->types_to_pickle);
  __Pyx_DECREF(__pyx_v___pyx_result->types_to_pickle);
  __pyx_v___pyx_result->types_to_pickle = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(9, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->whitelisted_types);
  __Pyx_DECREF(__pyx_v___pyx_result->whitelisted_types);
  __pyx_v___pyx_result->whitelisted_types = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_SerializationContext__set_state(SerializationContext __pyx_result, tuple __pyx_state):
 *     __pyx_result.custom_deserializers = __pyx_state[0]; __pyx_result.custom_serializers = __pyx_state[1]; __pyx_result.pickle_deserializer = __pyx_state[2]; __pyx_result.pickle_serializer = __pyx_state[3]; __pyx_result.type_to_type_id = __pyx_state[4]; __pyx_result.types_to_pickle = __pyx_state[5]; __pyx_result.whitelisted_types = __pyx_state[6]
 *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[7])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(9, 13, __pyx_L1_error)
  }
  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(9, 13, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 > 7) != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(9, 13, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_4 != 0);
  __pyx_t_2 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":14
 *     __pyx_result.custom_deserializers = __pyx_state[0]; __pyx_result.custom_serializers = __pyx_state[1]; __pyx_result.pickle_deserializer = __pyx_state[2]; __pyx_result.pickle_serializer = __pyx_state[3]; __pyx_result.type_to_type_id = __pyx_state[4]; __pyx_result.types_to_pickle = __pyx_state[5]; __pyx_result.whitelisted_types = __pyx_state[6]
 *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[7])             # <<<<<<<<<<<<<<
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(9, 14, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_SerializationContext__set_state(SerializationContext __pyx_result, tuple __pyx_state):
 *     __pyx_result.custom_deserializers = __pyx_state[0]; __pyx_result.custom_serializers = __pyx_state[1]; __pyx_result.pickle_deserializer = __pyx_state[2]; __pyx_result.pickle_serializer = __pyx_state[3]; __pyx_result.type_to_type_id = __pyx_state[4]; __pyx_result.types_to_pickle = __pyx_state[5]; __pyx_result.whitelisted_types = __pyx_state[6]
 *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[7])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_SerializationContext__set_state(<SerializationContext> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_SerializationContext__set_state(SerializationContext __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.custom_deserializers = __pyx_state[0]; __pyx_result.custom_serializers = __pyx_state[1]; __pyx_result.pickle_deserializer = __pyx_state[2]; __pyx_result.pickle_serializer = __pyx_state[3]; __pyx_result.type_to_type_id = __pyx_state[4]; __pyx_result.types_to_pickle = __pyx_state[5]; __pyx_result.whitelisted_types = __pyx_state[6]
 *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.__pyx_unpickle_SerializationContext__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/includes/common.pxd":72
 * 
 * 
 * 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":74
 * 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":75
 *     # 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":76
 *     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":72
 * 
 * 
 * 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(9, 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(9, 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(9, 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__228, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 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(9, 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(9, 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(9, 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_2); __pyx_t_2 = 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;

    /* "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(9, 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__229, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 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(9, 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(9, 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(9, 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_2); __pyx_t_2 = 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;

    /* "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(9, 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__230, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 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(9, 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(9, 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(9, 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_2); __pyx_t_2 = 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;

    /* "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(9, 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__231, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 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(9, 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(9, 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(9, 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_2); __pyx_t_2 = 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;

    /* "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(9, 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
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__232, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 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(9, 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             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['deduplicate_objects']
 */
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_10 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(9, 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
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['deduplicate_objects']
 *     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":42
 *     result.use_threads = value
 *     try:
 *         value = obj['deduplicate_objects']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'deduplicate_objects'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_deduplicate_objects); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 42, __pyx_L44_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":41
 *         raise ValueError("No value specified for struct attribute 'use_threads'")
 *     result.use_threads = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['deduplicate_objects']
 *     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_L49_try_end;
    __pyx_L44_error:;
    __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;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":43
 *     try:
 *         value = obj['deduplicate_objects']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'deduplicate_objects'")
 *     result.deduplicate_objects = 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(9, 43, __pyx_L46_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_2);

      /* "FromPyStructUtility":44
 *         value = obj['deduplicate_objects']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'deduplicate_objects'")             # <<<<<<<<<<<<<<
 *     result.deduplicate_objects = value
 *     return result
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__233, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 44, __pyx_L46_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(9, 44, __pyx_L46_except_error)
    }
    goto __pyx_L46_except_error;
    __pyx_L46_except_error:;

    /* "FromPyStructUtility":41
 *         raise ValueError("No value specified for struct attribute 'use_threads'")
 *     result.use_threads = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['deduplicate_objects']
 *     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_L49_try_end:;
  }

  /* "FromPyStructUtility":45
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'deduplicate_objects'")
 *     result.deduplicate_objects = value             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_10 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(9, 45, __pyx_L1_error)
  __pyx_v_result.deduplicate_objects = __pyx_t_10;

  /* "FromPyStructUtility":46
 *         raise ValueError("No value specified for struct attribute 'deduplicate_objects'")
 *     result.deduplicate_objects = 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(9, 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(9, 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(9, 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(9, 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(9, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "string.to_py":55
 * 
 * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("string.to_py.__pyx_convert_PyByteArray_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "string.from_py":13
 * 
 * @cname("__pyx_convert_string_from_py_std__in_string")
 * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length = 0
 *     cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
 */

static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v_o) {
  Py_ssize_t __pyx_v_length;
  char const *__pyx_v_data;
  std::string __pyx_r;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  __Pyx_RefNannySetupContext("__pyx_convert_string_from_py_std__in_string", 0);

  /* "string.from_py":14
 * @cname("__pyx_convert_string_from_py_std__in_string")
 * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:
 *     cdef Py_ssize_t length = 0             # <<<<<<<<<<<<<<
 *     cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
 *     return string(data, length)
 */
  __pyx_v_length = 0;

  /* "string.from_py":15
 * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:
 *     cdef Py_ssize_t length = 0
 *     cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)             # <<<<<<<<<<<<<<
 *     return string(data, length)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_AsStringAndSize(__pyx_v_o, (&__pyx_v_length)); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(9, 15, __pyx_L1_error)
  __pyx_v_data = __pyx_t_1;

  /* "string.from_py":16
 *     cdef Py_ssize_t length = 0
 *     cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
 *     return string(data, length)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::string(__pyx_v_data, __pyx_v_length);
  goto __pyx_L0;

  /* "string.from_py":13
 * 
 * @cname("__pyx_convert_string_from_py_std__in_string")
 * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length = 0
 *     cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("string.from_py.__pyx_convert_string_from_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "vector.to_py":60
 * 
 * @cname("__pyx_convert_vector_to_py_uint8_t")
 * cdef object __pyx_convert_vector_to_py_uint8_t(vector[X]& v):             # <<<<<<<<<<<<<<
 *     return [v[i] for i in range(v.size())]
 * 
 */

static PyObject *__pyx_convert_vector_to_py_uint8_t(const std::vector<uint8_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_uint8_t", 0);

  /* "vector.to_py":61
 * @cname("__pyx_convert_vector_to_py_uint8_t")
 * cdef object __pyx_convert_vector_to_py_uint8_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(9, 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_uint8_t((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 61, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(9, 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_uint8_t")
 * cdef object __pyx_convert_vector_to_py_uint8_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_uint8_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_convert_vector_to_py_int64_t(const std::vector<int64_t>  &__pyx_v_v) {
  size_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_int64_t", 0);

  /* "vector.to_py":61
 * @cname("__pyx_convert_vector_to_py_int64_t")
 * cdef object __pyx_convert_vector_to_py_int64_t(vector[X]& v):
 *     return [v[i] for i in range(v.size())]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 61, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(9, 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;
}

/* "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(9, 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(9, 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(9, 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(9, 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(9, 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(9, 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(9, 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(9, 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;
}

/* "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(9, 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(9, 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(9, 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(9, 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(9, 178, __pyx_L1_error)
    __pyx_t_9 = __pyx_convert_string_from_py_std__in_string(__pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 178, __pyx_L1_error)
    __pyx_v_m.insert(std::pair<std::string,std::string> (((std::string)__pyx_t_8), ((std::string)__pyx_t_9)));
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "map.from_py":179
 *     for key, value in d.iteritems():
 *         m.insert(pair[X,Y](<X>key, <Y>value))
 *     return m             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_m;
  goto __pyx_L0;

  /* "map.from_py":174
 * 
 * @cname("__pyx_convert_unordered_map_from_py_std_3a__3a_string__and_std_3a__3a_string")
 * cdef map[X,Y] __pyx_convert_unordered_map_from_py_std_3a__3a_string__and_std_3a__3a_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef dict d = o
 *     cdef map[X,Y] m
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("map.from_py.__pyx_convert_unordered_map_from_py_std_3a__3a_string__and_std_3a__3a_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "vector.from_py":45
 * 
 * @cname("__pyx_convert_vector_from_py_std_3a__3a_string")
 * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef vector[X] v
 *     for item in o:
 */

static std::vector<std::string>  __pyx_convert_vector_from_py_std_3a__3a_string(PyObject *__pyx_v_o) {
  std::vector<std::string>  __pyx_v_v;
  PyObject *__pyx_v_item = NULL;
  std::vector<std::string>  __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_std_3a__3a_string", 0);

  /* "vector.from_py":47
 * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_string(object o) except *:
 *     cdef vector[X] v
 *     for item in o:             # <<<<<<<<<<<<<<
 *         v.push_back(<X>item)
 *     return v
 */
  if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
    __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 47, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(9, 47, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 47, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(9, 47, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 47, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(9, 47, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "vector.from_py":48
 *     cdef vector[X] v
 *     for item in o:
 *         v.push_back(<X>item)             # <<<<<<<<<<<<<<
 *     return v
 * 
 */
    __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_v_item); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 48, __pyx_L1_error)
    __pyx_v_v.push_back(((std::string)__pyx_t_5));

    /* "vector.from_py":47
 * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_string(object o) except *:
 *     cdef vector[X] v
 *     for item in o:             # <<<<<<<<<<<<<<
 *         v.push_back(<X>item)
 *     return v
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "vector.from_py":49
 *     for item in o:
 *         v.push_back(<X>item)
 *     return v             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_v;
  goto __pyx_L0;

  /* "vector.from_py":45
 * 
 * @cname("__pyx_convert_vector_from_py_std_3a__3a_string")
 * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef vector[X] v
 *     for item in o:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_std_3a__3a_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_tp_new_7pyarrow_3lib_Message(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Message *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Message *)o);
  new((void*)&(p->message)) std::unique_ptr< arrow::ipc::Message> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_7Message_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_Message(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_Message *p = (struct __pyx_obj_7pyarrow_3lib_Message *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->message);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_7Message_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_7Message_4type_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_7Message_metadata(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_7Message_8metadata_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_7Message_body(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_7Message_4body_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Message[] = {
  {"equals", (PyCFunction)__pyx_pw_7pyarrow_3lib_7Message_5equals, METH_O, __pyx_doc_7pyarrow_3lib_7Message_4equals},
  {"serialize", (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*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_7Message_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
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_MemoryPool __pyx_vtable_7pyarrow_3lib_MemoryPool;

static PyObject *__pyx_tp_new_7pyarrow_3lib_MemoryPool(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_MemoryPool;
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_MemoryPool(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_MemoryPool[] = {
  {"bytes_allocated", (PyCFunction)__pyx_pw_7pyarrow_3lib_10MemoryPool_3bytes_allocated, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10MemoryPool_2bytes_allocated},
  {"max_memory", (PyCFunction)__pyx_pw_7pyarrow_3lib_10MemoryPool_5max_memory, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10MemoryPool_4max_memory},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10MemoryPool_7__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10MemoryPool_6__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10MemoryPool_9__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_10MemoryPool_8__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_MemoryPool = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.MemoryPool", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_MemoryPool), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_MemoryPool, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "MemoryPool()\n\n    Base class for memory allocation.\n\n    Besides tracking its number of allocated bytes, a memory pool also\n    takes care of the required 64-byte alignment for Arrow data.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_MemoryPool, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_10MemoryPool_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_MemoryPool, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_vtable_7pyarrow_3lib_DataType;

static PyObject *__pyx_tp_new_7pyarrow_3lib_DataType(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_DataType *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_DataType *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_DataType;
  new((void*)&(p->sp_type)) std::shared_ptr< arrow::DataType> ();
  p->pep3118_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7pyarrow_3lib_8DataType_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_DataType(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_DataType *p = (struct __pyx_obj_7pyarrow_3lib_DataType *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __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*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  __pyx_pw_7pyarrow_3lib_8DataType_7__hash__, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "DataType()\n\n    Base class of all Arrow data types.\n\n    Each data type is an *instance* of this class.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_DataType, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_DataType, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_DataType, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_DataType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ListType __pyx_vtable_7pyarrow_3lib_ListType;

static PyObject *__pyx_tp_new_7pyarrow_3lib_ListType(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_ListType *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_DataType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_ListType *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_ListType;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_8ListType_value_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_8ListType_10value_type_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_ListType[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_8ListType_1__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_8ListType___reduce__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_ListType[] = {
  {(char *)"value_type", __pyx_getprop_7pyarrow_3lib_8ListType_value_type, 0, (char *)"\n        The data type of list values.\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_ListType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.ListType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_ListType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Concrete class for list data types.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_ListType, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_ListType, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_ListType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_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 *)"\n        The number of struct fields.\n        ", 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*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_StructType, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_StructType, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Concrete class for struct data types.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_3lib_10StructType_3__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_StructType, /*tp_methods*/
  0, /*tp_members*/
  __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
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DictionaryType __pyx_vtable_7pyarrow_3lib_DictionaryType;

static PyObject *__pyx_tp_new_7pyarrow_3lib_DictionaryType(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_DictionaryType *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_DataType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_DictionaryType *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_DictionaryType;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14DictionaryType_ordered(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14DictionaryType_7ordered_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14DictionaryType_index_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14DictionaryType_10index_type_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14DictionaryType_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 *)"\n        Whether the dictionary is ordered, i.e. whether the ordering of values\n        in the dictionary is important.\n        ", 0},
  {(char *)"index_type", __pyx_getprop_7pyarrow_3lib_14DictionaryType_index_type, 0, (char *)"\n        The data type of dictionary indices (a signed integer type).\n        ", 0},
  {(char *)"dictionary", __pyx_getprop_7pyarrow_3lib_14DictionaryType_dictionary, 0, (char *)"\n        The dictionary array, mapping dictionary indices to values.\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_DictionaryType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.DictionaryType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_DictionaryType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Concrete class for dictionary data types.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_DictionaryType, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_DictionaryType, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_DictionaryType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_TimestampType __pyx_vtable_7pyarrow_3lib_TimestampType;

static PyObject *__pyx_tp_new_7pyarrow_3lib_TimestampType(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_TimestampType *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_DataType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_TimestampType *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_TimestampType;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_13TimestampType_unit(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_13TimestampType_4unit_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_13TimestampType_tz(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_13TimestampType_2tz_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_TimestampType[] = {
  {"to_pandas_dtype", (PyCFunction)__pyx_pw_7pyarrow_3lib_13TimestampType_1to_pandas_dtype, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13TimestampType_to_pandas_dtype},
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13TimestampType_3__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13TimestampType_2__reduce__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_TimestampType[] = {
  {(char *)"unit", __pyx_getprop_7pyarrow_3lib_13TimestampType_unit, 0, (char *)"\n        The timestamp unit ('s', 'ms', 'us' or 'ns').\n        ", 0},
  {(char *)"tz", __pyx_getprop_7pyarrow_3lib_13TimestampType_tz, 0, (char *)"\n        The timestamp time zone, if any, or None.\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_TimestampType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.TimestampType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_TimestampType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Concrete class for timestamp data types.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_TimestampType, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_TimestampType, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_TimestampType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Time32Type __pyx_vtable_7pyarrow_3lib_Time32Type;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Time32Type(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Time32Type *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_DataType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Time32Type *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_Time32Type;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_10Time32Type_unit(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_10Time32Type_4unit_1__get__(o);
}

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_Time32Type[] = {
  {(char *)"unit", __pyx_getprop_7pyarrow_3lib_10Time32Type_unit, 0, (char *)"\n        The time unit ('s', 'ms', 'us' or 'ns').\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Time32Type = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Time32Type", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Time32Type), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Concrete class for time32 data types.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_Time32Type, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Time32Type, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Time64Type __pyx_vtable_7pyarrow_3lib_Time64Type;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Time64Type(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Time64Type *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_DataType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Time64Type *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_Time64Type;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_10Time64Type_unit(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_10Time64Type_4unit_1__get__(o);
}

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_Time64Type[] = {
  {(char *)"unit", __pyx_getprop_7pyarrow_3lib_10Time64Type_unit, 0, (char *)"\n        The time unit ('s', 'ms', 'us' or 'ns').\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Time64Type = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Time64Type", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Time64Type), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Concrete class for time64 data types.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_Time64Type, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Time64Type, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryType __pyx_vtable_7pyarrow_3lib_FixedSizeBinaryType;

static PyObject *__pyx_tp_new_7pyarrow_3lib_FixedSizeBinaryType(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_DataType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryType;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_19FixedSizeBinaryType_byte_width(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_19FixedSizeBinaryType_10byte_width_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_FixedSizeBinaryType[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_19FixedSizeBinaryType_1__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_19FixedSizeBinaryType___reduce__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_FixedSizeBinaryType[] = {
  {(char *)"byte_width", __pyx_getprop_7pyarrow_3lib_19FixedSizeBinaryType_byte_width, 0, (char *)"\n        The binary size in bytes.\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_FixedSizeBinaryType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.FixedSizeBinaryType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Concrete class for fixed-size binary data types.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_FixedSizeBinaryType, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_FixedSizeBinaryType, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_FixedSizeBinaryType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Decimal128Type __pyx_vtable_7pyarrow_3lib_Decimal128Type;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Decimal128Type(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Decimal128Type *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_FixedSizeBinaryType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Decimal128Type *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_Decimal128Type;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14Decimal128Type_precision(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14Decimal128Type_9precision_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14Decimal128Type_scale(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14Decimal128Type_5scale_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Decimal128Type[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14Decimal128Type_1__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_14Decimal128Type___reduce__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_Decimal128Type[] = {
  {(char *)"precision", __pyx_getprop_7pyarrow_3lib_14Decimal128Type_precision, 0, (char *)"\n        The decimal precision, in number of decimal digits (an integer).\n        ", 0},
  {(char *)"scale", __pyx_getprop_7pyarrow_3lib_14Decimal128Type_scale, 0, (char *)"\n        The decimal scale (an integer).\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Decimal128Type = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Decimal128Type", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal128Type), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Concrete class for decimal128 data types.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Decimal128Type, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_Decimal128Type, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Decimal128Type, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_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*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_5Field_13__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  __pyx_pw_7pyarrow_3lib_5Field_15__hash__, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_7pyarrow_3lib_5Field_11__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Field()\n\n    A named field, with a data type, nullability, and optional metadata.\n\n    Notes\n    -----\n    Do not use this class's constructor directly; use pyarrow.field\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Field, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Field, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_Field, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Field, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_Field, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_5Field_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Field, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Schema __pyx_vtable_7pyarrow_3lib_Schema;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Schema(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Schema *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Schema *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_Schema;
  new((void*)&(p->sp_schema)) std::shared_ptr< arrow::Schema> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_6Schema_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_Schema(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_Schema *p = (struct __pyx_obj_7pyarrow_3lib_Schema *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->sp_schema);
  (*Py_TYPE(o)->tp_free)(o);
}
static PyObject *__pyx_sq_item_7pyarrow_3lib_Schema(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_tp_richcompare_7pyarrow_3lib_Schema(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_6Schema_16__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_6Schema_16__eq__(o1, o2);
      if (likely(ret && ret != Py_NotImplemented)) {
        int b = __Pyx_PyObject_IsTrue(ret); Py_DECREF(ret);
        if (unlikely(b < 0)) return NULL;
        ret = (b) ? Py_False : Py_True;
        Py_INCREF(ret);
      }
      return ret;
    }
    default: {
      return __Pyx_NewRef(Py_NotImplemented);
    }
  }
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Schema_pandas_metadata(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Schema_15pandas_metadata_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Schema_names(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Schema_5names_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Schema_types(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Schema_5types_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Schema_metadata(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Schema_8metadata_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Schema[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_12__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6Schema_11__reduce__},
  {"empty_table", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_18empty_table, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6Schema_17empty_table},
  {"equals", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Schema_20equals, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Schema_19equals},
  {"from_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Schema_22from_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Schema_21from_pandas},
  {"field_by_name", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_24field_by_name, METH_O, __pyx_doc_7pyarrow_3lib_6Schema_23field_by_name},
  {"get_field_index", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_26get_field_index, METH_O, __pyx_doc_7pyarrow_3lib_6Schema_25get_field_index},
  {"append", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_28append, METH_O, __pyx_doc_7pyarrow_3lib_6Schema_27append},
  {"insert", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Schema_30insert, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Schema_29insert},
  {"remove", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_32remove, METH_O, __pyx_doc_7pyarrow_3lib_6Schema_31remove},
  {"set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Schema_34set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Schema_33set},
  {"add_metadata", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_36add_metadata, METH_O, __pyx_doc_7pyarrow_3lib_6Schema_35add_metadata},
  {"serialize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Schema_38serialize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Schema_37serialize},
  {"remove_metadata", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_40remove_metadata, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6Schema_39remove_metadata},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_Schema[] = {
  {(char *)"pandas_metadata", __pyx_getprop_7pyarrow_3lib_6Schema_pandas_metadata, 0, (char *)"\n        Return deserialized-from-JSON pandas metadata field (if it exists)\n        ", 0},
  {(char *)"names", __pyx_getprop_7pyarrow_3lib_6Schema_names, 0, (char *)"\n        The schema's field names.\n\n        Returns\n        -------\n        list of str\n        ", 0},
  {(char *)"types", __pyx_getprop_7pyarrow_3lib_6Schema_types, 0, (char *)"\n        The schema's field types.\n\n        Returns\n        -------\n        list of DataType\n        ", 0},
  {(char *)"metadata", __pyx_getprop_7pyarrow_3lib_6Schema_metadata, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_Schema = {
  __pyx_pw_7pyarrow_3lib_6Schema_5__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7pyarrow_3lib_Schema, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Schema = {
  __pyx_pw_7pyarrow_3lib_6Schema_5__len__, /*mp_length*/
  __pyx_pw_7pyarrow_3lib_6Schema_7__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Schema = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Schema", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Schema), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Schema, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_6Schema_44__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_Schema, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Schema, /*tp_as_mapping*/
  __pyx_pw_7pyarrow_3lib_6Schema_14__hash__, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_7pyarrow_3lib_6Schema_42__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "Schema()", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_Schema, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_3lib_6Schema_9__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Schema, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_Schema, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_6Schema_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Schema, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib_Scalar(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Scalar *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Scalar *)o);
  p->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_Scalar(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_Scalar *p = (struct __pyx_obj_7pyarrow_3lib_Scalar *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->type);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_Scalar(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_Scalar *p = (struct __pyx_obj_7pyarrow_3lib_Scalar *)o;
  if (p->type) {
    e = (*v)(((PyObject *)p->type), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_Scalar(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_Scalar *p = (struct __pyx_obj_7pyarrow_3lib_Scalar *)o;
  tmp = ((PyObject*)p->type);
  p->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Scalar_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Scalar_4type_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Scalar[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Scalar_1__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6Scalar___reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Scalar_3__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_6Scalar_2__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_Scalar[] = {
  {(char *)"type", __pyx_getprop_7pyarrow_3lib_6Scalar_type, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Scalar = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Scalar", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Scalar), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Scalar, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    The base class for all array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Scalar, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_Scalar, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Scalar, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib_NAType(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Scalar(t, a, k);
  if (unlikely(!o)) return 0;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_NAType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.NAType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_NAType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Scalar, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_NAType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_vtable_7pyarrow_3lib_ArrayValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_ArrayValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Scalar(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_ArrayValue *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  new((void*)&(p->sp_array)) std::shared_ptr< arrow::Array> ();
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue *p = (struct __pyx_obj_7pyarrow_3lib_ArrayValue *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->sp_array);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib_Scalar(o);
}

static PyObject *__pyx_tp_richcompare_7pyarrow_3lib_ArrayValue(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_10ArrayValue_7__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_10ArrayValue_7__eq__(o1, o2);
      if (likely(ret && ret != Py_NotImplemented)) {
        int b = __Pyx_PyObject_IsTrue(ret); Py_DECREF(ret);
        if (unlikely(b < 0)) return NULL;
        ret = (b) ? Py_False : Py_True;
        Py_INCREF(ret);
      }
      return ret;
    }
    default: {
      return __Pyx_NewRef(Py_NotImplemented);
    }
  }
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_ArrayValue[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10ArrayValue_11__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10ArrayValue_10__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10ArrayValue_13__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_10ArrayValue_12__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_ArrayValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.ArrayValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_ArrayValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  __pyx_pw_7pyarrow_3lib_10ArrayValue_9__hash__, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "ArrayValue()\n\n    The base class for non-null array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_ArrayValue, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_ArrayValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_ArrayValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue __pyx_vtable_7pyarrow_3lib_ScalarValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_ScalarValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_ScalarValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Scalar(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_ScalarValue *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_ScalarValue;
  new((void*)&(p->sp_scalar)) std::shared_ptr< arrow::Scalar> ();
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_ScalarValue *p = (struct __pyx_obj_7pyarrow_3lib_ScalarValue *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->sp_scalar);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib_Scalar(o);
}

static PyObject *__pyx_tp_richcompare_7pyarrow_3lib_ScalarValue(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_11ScalarValue_7__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_11ScalarValue_7__eq__(o1, o2);
      if (likely(ret && ret != Py_NotImplemented)) {
        int b = __Pyx_PyObject_IsTrue(ret); Py_DECREF(ret);
        if (unlikely(b < 0)) return NULL;
        ret = (b) ? Py_False : Py_True;
        Py_INCREF(ret);
      }
      return ret;
    }
    default: {
      return __Pyx_NewRef(Py_NotImplemented);
    }
  }
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_ScalarValue[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11ScalarValue_11__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11ScalarValue_10__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11ScalarValue_13__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11ScalarValue_12__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_ScalarValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.ScalarValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_ScalarValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  __pyx_pw_7pyarrow_3lib_11ScalarValue_9__hash__, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "ScalarValue()\n\n    The base class for scalars.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_ScalarValue, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_ScalarValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_ScalarValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int8Value __pyx_vtable_7pyarrow_3lib_Int8Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int8Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int8Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int8Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_Int8Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Int8Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_9Int8Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_9Int8Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_9Int8Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_9Int8Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_9Int8Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_9Int8Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Int8Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int8Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int8Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for int8 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Int8Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int8Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int64Value __pyx_vtable_7pyarrow_3lib_Int64Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int64Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int64Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int64Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_Int64Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Int64Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int64Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10Int64Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int64Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10Int64Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int64Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_10Int64Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Int64Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int64Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int64Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for int64 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Int64Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int64Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ListValue __pyx_vtable_7pyarrow_3lib_ListValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_ListValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_ListValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_ListValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_ListValue;
  p->value_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_ListValue(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_ListValue *p = (struct __pyx_obj_7pyarrow_3lib_ListValue *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->value_type);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_ListValue(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_ListValue *p = (struct __pyx_obj_7pyarrow_3lib_ListValue *)o;
  e = __pyx_tp_traverse_7pyarrow_3lib_Scalar(o, v, a); if (e) return e;
  if (p->value_type) {
    e = (*v)(((PyObject *)p->value_type), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_ListValue(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_ListValue *p = (struct __pyx_obj_7pyarrow_3lib_ListValue *)o;
  __pyx_tp_clear_7pyarrow_3lib_Scalar(o);
  tmp = ((PyObject*)p->value_type);
  p->value_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
static PyObject *__pyx_sq_item_7pyarrow_3lib_ListValue(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_9ListValue_value_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_9ListValue_10value_type_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_ListValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_9ListValue_8as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_9ListValue_7as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_9ListValue_10__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_9ListValue_9__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_9ListValue_12__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_9ListValue_11__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_ListValue[] = {
  {(char *)"value_type", __pyx_getprop_7pyarrow_3lib_9ListValue_value_type, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_ListValue = {
  __pyx_pw_7pyarrow_3lib_9ListValue_1__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7pyarrow_3lib_ListValue, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_ListValue = {
  __pyx_pw_7pyarrow_3lib_9ListValue_1__len__, /*mp_length*/
  __pyx_pw_7pyarrow_3lib_9ListValue_3__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_ListValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.ListValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_ListValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ListValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_ListValue, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_ListValue, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for list array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_ListValue, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_ListValue, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_3lib_9ListValue_5__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_ListValue, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_ListValue, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_ListValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_StructValue __pyx_vtable_7pyarrow_3lib_StructValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_StructValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_StructValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_StructValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_StructValue;
  return o;
}
static PyObject *__pyx_sq_item_7pyarrow_3lib_StructValue(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_StructValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11StructValue_3as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11StructValue_2as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11StructValue_5__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11StructValue_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11StructValue_7__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11StructValue_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_StructValue = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7pyarrow_3lib_StructValue, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_StructValue = {
  0, /*mp_length*/
  __pyx_pw_7pyarrow_3lib_11StructValue_1__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_StructValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.StructValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_StructValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_StructValue, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_StructValue, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for struct array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_StructValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_StructValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UnionValue __pyx_vtable_7pyarrow_3lib_UnionValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UnionValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UnionValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UnionValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_UnionValue;
  p->value_types = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_UnionValue(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_UnionValue *p = (struct __pyx_obj_7pyarrow_3lib_UnionValue *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->value_types);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_UnionValue(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_UnionValue *p = (struct __pyx_obj_7pyarrow_3lib_UnionValue *)o;
  e = __pyx_tp_traverse_7pyarrow_3lib_Scalar(o, v, a); if (e) return e;
  if (p->value_types) {
    e = (*v)(p->value_types, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_UnionValue(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_UnionValue *p = (struct __pyx_obj_7pyarrow_3lib_UnionValue *)o;
  __pyx_tp_clear_7pyarrow_3lib_Scalar(o);
  tmp = ((PyObject*)p->value_types);
  p->value_types = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_UnionValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_10UnionValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10UnionValue_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10UnionValue_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10UnionValue_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10UnionValue_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_10UnionValue_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_UnionValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UnionValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UnionValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_UnionValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for union array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_UnionValue, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_UnionValue, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_UnionValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UnionValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_StringValue __pyx_vtable_7pyarrow_3lib_StringValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_StringValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_StringValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_StringValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_StringValue;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_StringValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11StringValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11StringValue_as_py},
  {"__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*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for string (utf8) array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_StringValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_StringValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryValue __pyx_vtable_7pyarrow_3lib_FixedSizeBinaryValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_FixedSizeBinaryValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryValue;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_FixedSizeBinaryValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_20FixedSizeBinaryValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_20FixedSizeBinaryValue_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_20FixedSizeBinaryValue_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_20FixedSizeBinaryValue_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_20FixedSizeBinaryValue_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_20FixedSizeBinaryValue_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_FixedSizeBinaryValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.FixedSizeBinaryValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for fixed-size binary array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_FixedSizeBinaryValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_FixedSizeBinaryValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib__PandasConvertible(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib__PandasConvertible(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib__PandasConvertible[] = {
  {"to_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_18_PandasConvertible_1to_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_18_PandasConvertible_to_pandas},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_18_PandasConvertible_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_18_PandasConvertible_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_18_PandasConvertible_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_18_PandasConvertible_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib__PandasConvertible = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib._PandasConvertible", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib__PandasConvertible), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib__PandasConvertible, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib__PandasConvertible, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib__PandasConvertible, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_vtable_7pyarrow_3lib_Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib__PandasConvertible(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Array *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_Array;
  new((void*)&(p->sp_array)) std::shared_ptr< arrow::Array> ();
  p->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  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);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib__PandasConvertible(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_Array(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_Array *p = (struct __pyx_obj_7pyarrow_3lib_Array *)o;
  e = ((likely(__pyx_ptype_7pyarrow_3lib__PandasConvertible)) ? ((__pyx_ptype_7pyarrow_3lib__PandasConvertible->tp_traverse) ? __pyx_ptype_7pyarrow_3lib__PandasConvertible->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_3lib_Array)); if (e) return e;
  if (p->type) {
    e = (*v)(((PyObject *)p->type), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_Array(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_Array *p = (struct __pyx_obj_7pyarrow_3lib_Array *)o;
  if (likely(__pyx_ptype_7pyarrow_3lib__PandasConvertible)) { if (__pyx_ptype_7pyarrow_3lib__PandasConvertible->tp_clear) __pyx_ptype_7pyarrow_3lib__PandasConvertible->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_3lib_Array);
  tmp = ((PyObject*)p->type);
  p->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  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},
  {"sum", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_9sum, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_8sum},
  {"unique", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_11unique, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_10unique},
  {"dictionary_encode", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_13dictionary_encode, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_12dictionary_encode},
  {"from_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_15from_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_14from_pandas},
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_17__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_16__reduce__},
  {"from_buffers", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_19from_buffers, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_18from_buffers},
  {"format", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_26format, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_25format},
  {"equals", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_30equals, METH_O, __pyx_doc_7pyarrow_3lib_5Array_29equals},
  {"isnull", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_34isnull, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_33isnull},
  {"slice", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_38slice, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_37slice},
  {"_to_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_40_to_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_39_to_pandas},
  {"__array__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_42__array__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_41__array__},
  {"to_numpy", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_44to_numpy, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_43to_numpy},
  {"to_pylist", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_46to_pylist, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_45to_pylist},
  {"validate", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_48validate, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_47validate},
  {"buffers", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_50buffers, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_49buffers},
  {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_32__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_32__len__, /*mp_length*/
  __pyx_pw_7pyarrow_3lib_5Array_36__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_5Array_24__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_28__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Array()\n\n    The base class for all Arrow arrays.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_Array, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_3lib_5Array_21__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Array, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_Array, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Tensor __pyx_vtable_7pyarrow_3lib_Tensor;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Tensor(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Tensor *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Tensor *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_Tensor;
  new((void*)&(p->sp_tensor)) std::shared_ptr< arrow::Tensor> ();
  p->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_Tensor(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_Tensor *p = (struct __pyx_obj_7pyarrow_3lib_Tensor *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->sp_tensor);
  Py_CLEAR(p->type);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_Tensor(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_Tensor *p = (struct __pyx_obj_7pyarrow_3lib_Tensor *)o;
  if (p->type) {
    e = (*v)(((PyObject *)p->type), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_Tensor(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_Tensor *p = (struct __pyx_obj_7pyarrow_3lib_Tensor *)o;
  tmp = ((PyObject*)p->type);
  p->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_tp_richcompare_7pyarrow_3lib_Tensor(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_6Tensor_11__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_6Tensor_11__eq__(o1, o2);
      if (likely(ret && ret != Py_NotImplemented)) {
        int b = __Pyx_PyObject_IsTrue(ret); Py_DECREF(ret);
        if (unlikely(b < 0)) return NULL;
        ret = (b) ? Py_False : Py_True;
        Py_INCREF(ret);
      }
      return ret;
    }
    default: {
      return __Pyx_NewRef(Py_NotImplemented);
    }
  }
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Tensor_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*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_6Tensor_3__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Tensor, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Tensor()\n\n    A n-dimensional array a.k.a Tensor.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Tensor, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Tensor, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_Tensor, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Tensor, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_Tensor, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_6Tensor_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Tensor, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_NullArray __pyx_vtable_7pyarrow_3lib_NullArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_NullArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_NullArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_NullArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_NullArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_NullArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.NullArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_NullArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_24__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_28__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of null data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_21__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_NullArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BooleanArray __pyx_vtable_7pyarrow_3lib_BooleanArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_BooleanArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_BooleanArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_BooleanArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_BooleanArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_BooleanArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.BooleanArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_BooleanArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_24__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_28__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of boolean data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_21__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_BooleanArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_NumericArray __pyx_vtable_7pyarrow_3lib_NumericArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_NumericArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_NumericArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_NumericArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_NumericArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_NumericArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.NumericArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_NumericArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_24__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_28__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    A base class for Arrow numeric arrays.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_21__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_NumericArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_IntegerArray __pyx_vtable_7pyarrow_3lib_IntegerArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_IntegerArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_IntegerArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NumericArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_IntegerArray *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_IntegerArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_IntegerArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.IntegerArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_IntegerArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_24__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_28__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    A base class for Arrow integer arrays.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_21__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_IntegerArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FloatingPointArray __pyx_vtable_7pyarrow_3lib_FloatingPointArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_FloatingPointArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_FloatingPointArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NumericArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_FloatingPointArray *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_FloatingPointArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_FloatingPointArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.FloatingPointArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_FloatingPointArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_24__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_28__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    A base class for Arrow floating-point arrays.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_21__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_FloatingPointArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int8Array __pyx_vtable_7pyarrow_3lib_Int8Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int8Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int8Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_IntegerArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int8Array *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_Int8Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_Int8Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int8Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int8Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_24__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_28__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of int8 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_21__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int8Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt8Array __pyx_vtable_7pyarrow_3lib_UInt8Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt8Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt8Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_IntegerArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt8Array *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_UInt8Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt8Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt8Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt8Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_24__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_28__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of uint8 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_21__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt8Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int16Array __pyx_vtable_7pyarrow_3lib_Int16Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int16Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int16Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_IntegerArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int16Array *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_Int16Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_Int16Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int16Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int16Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_24__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_28__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of int16 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_21__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int16Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt16Array __pyx_vtable_7pyarrow_3lib_UInt16Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt16Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt16Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_IntegerArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt16Array *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_UInt16Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt16Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt16Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt16Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_24__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_28__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of uint16 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_21__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt16Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int32Array __pyx_vtable_7pyarrow_3lib_Int32Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int32Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int32Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_IntegerArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int32Array *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_Int32Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_Int32Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int32Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int32Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_24__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_28__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of int32 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_21__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int32Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt32Array __pyx_vtable_7pyarrow_3lib_UInt32Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt32Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt32Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_IntegerArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt32Array *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_UInt32Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt32Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt32Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt32Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_24__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_28__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of uint32 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_21__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt32Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int64Array __pyx_vtable_7pyarrow_3lib_Int64Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int64Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int64Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_IntegerArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int64Array *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_Int64Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_Int64Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int64Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int64Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_24__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_28__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of int64 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_21__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int64Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt64Array __pyx_vtable_7pyarrow_3lib_UInt64Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt64Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt64Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_IntegerArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt64Array *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_UInt64Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt64Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt64Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt64Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_24__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_28__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of uint64 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_21__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt64Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_HalfFloatArray __pyx_vtable_7pyarrow_3lib_HalfFloatArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_HalfFloatArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_HalfFloatArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_FloatingPointArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_HalfFloatArray *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_HalfFloatArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_HalfFloatArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.HalfFloatArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_HalfFloatArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_24__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_28__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of float16 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_21__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_HalfFloatArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FloatArray __pyx_vtable_7pyarrow_3lib_FloatArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_FloatArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_FloatArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_FloatingPointArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_FloatArray *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_FloatArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_FloatArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.FloatArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_FloatArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_24__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_28__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of float32 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_21__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_FloatArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DoubleArray __pyx_vtable_7pyarrow_3lib_DoubleArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_DoubleArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_DoubleArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_FloatingPointArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_DoubleArray *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_DoubleArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_DoubleArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.DoubleArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_DoubleArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_24__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_28__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of float64 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_21__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_DoubleArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryArray __pyx_vtable_7pyarrow_3lib_FixedSizeBinaryArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_FixedSizeBinaryArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_FixedSizeBinaryArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.FixedSizeBinaryArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_24__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_28__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of a fixed-size binary data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_21__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_FixedSizeBinaryArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Decimal128Array __pyx_vtable_7pyarrow_3lib_Decimal128Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Decimal128Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Decimal128Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_FixedSizeBinaryArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Decimal128Array *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_Decimal128Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_Decimal128Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Decimal128Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal128Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_24__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_28__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of decimal128 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_21__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Decimal128Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_StructArray __pyx_vtable_7pyarrow_3lib_StructArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_StructArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_StructArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_StructArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_StructArray;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_StructArray[] = {
  {"field", (PyCFunction)__pyx_pw_7pyarrow_3lib_11StructArray_1field, METH_O, __pyx_doc_7pyarrow_3lib_11StructArray_field},
  {"flatten", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11StructArray_3flatten, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11StructArray_2flatten},
  {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11StructArray_5from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11StructArray_4from_arrays},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_StructArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.StructArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_StructArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_24__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_28__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of a struct data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_21__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_StructArray, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_StructArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ListArray __pyx_vtable_7pyarrow_3lib_ListArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_ListArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_ListArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_ListArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_ListArray;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_ListArray[] = {
  {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_9ListArray_1from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_9ListArray_from_arrays},
  {"flatten", (PyCFunction)__pyx_pw_7pyarrow_3lib_9ListArray_3flatten, METH_NOARGS, __pyx_doc_7pyarrow_3lib_9ListArray_2flatten},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_ListArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.ListArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_ListArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_24__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_28__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of a list data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_21__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
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UnionArray __pyx_vtable_7pyarrow_3lib_UnionArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UnionArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UnionArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UnionArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_UnionArray;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_UnionArray[] = {
  {"from_dense", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10UnionArray_1from_dense, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10UnionArray_from_dense},
  {"from_sparse", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10UnionArray_3from_sparse, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10UnionArray_2from_sparse},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_UnionArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UnionArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UnionArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_24__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_28__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of a Union data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_21__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_UnionArray, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UnionArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_StringArray __pyx_vtable_7pyarrow_3lib_StringArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_StringArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_StringArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_StringArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_StringArray;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_StringArray[] = {
  {"from_buffers", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11StringArray_1from_buffers, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11StringArray_from_buffers},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_StringArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.StringArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_StringArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_24__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_28__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of string (or utf8) data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_21__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_StringArray, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_StringArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BinaryArray __pyx_vtable_7pyarrow_3lib_BinaryArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_BinaryArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_BinaryArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_BinaryArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_BinaryArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_BinaryArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.BinaryArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_BinaryArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_24__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_28__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of variable-sized binary data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_21__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_BinaryArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DictionaryArray __pyx_vtable_7pyarrow_3lib_DictionaryArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_DictionaryArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_DictionaryArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_DictionaryArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_DictionaryArray;
  p->_indices = Py_None; Py_INCREF(Py_None);
  p->_dictionary = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_DictionaryArray(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_DictionaryArray *p = (struct __pyx_obj_7pyarrow_3lib_DictionaryArray *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_indices);
  Py_CLEAR(p->_dictionary);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib_Array(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_DictionaryArray(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_DictionaryArray *p = (struct __pyx_obj_7pyarrow_3lib_DictionaryArray *)o;
  e = __pyx_tp_traverse_7pyarrow_3lib_Array(o, v, a); if (e) return e;
  if (p->_indices) {
    e = (*v)(p->_indices, a); if (e) return e;
  }
  if (p->_dictionary) {
    e = (*v)(p->_dictionary, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_DictionaryArray(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_DictionaryArray *p = (struct __pyx_obj_7pyarrow_3lib_DictionaryArray *)o;
  __pyx_tp_clear_7pyarrow_3lib_Array(o);
  tmp = ((PyObject*)p->_indices);
  p->_indices = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_dictionary);
  p->_dictionary = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15DictionaryArray_dictionary(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15DictionaryArray_10dictionary_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15DictionaryArray_indices(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15DictionaryArray_7indices_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_DictionaryArray[] = {
  {"dictionary_encode", (PyCFunction)__pyx_pw_7pyarrow_3lib_15DictionaryArray_1dictionary_encode, METH_NOARGS, __pyx_doc_7pyarrow_3lib_15DictionaryArray_dictionary_encode},
  {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15DictionaryArray_3from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15DictionaryArray_2from_arrays},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_DictionaryArray[] = {
  {(char *)"dictionary", __pyx_getprop_7pyarrow_3lib_15DictionaryArray_dictionary, 0, (char *)0, 0},
  {(char *)"indices", __pyx_getprop_7pyarrow_3lib_15DictionaryArray_indices, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_DictionaryArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.DictionaryArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_DictionaryArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DictionaryArray, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_24__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_28__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for dictionary-encoded Arrow arrays.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_DictionaryArray, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_DictionaryArray, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_21__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_DictionaryArray, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_DictionaryArray, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_DictionaryArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ChunkedArray __pyx_vtable_7pyarrow_3lib_ChunkedArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_ChunkedArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_ChunkedArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib__PandasConvertible(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_ChunkedArray;
  new((void*)&(p->sp_chunked_array)) std::shared_ptr< arrow::ChunkedArray> ();
  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);
  __pyx_tp_dealloc_7pyarrow_3lib__PandasConvertible(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_tp_richcompare_7pyarrow_3lib_ChunkedArray(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_12ChunkedArray_22__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_12ChunkedArray_22__eq__(o1, o2);
      if (likely(ret && ret != Py_NotImplemented)) {
        int b = __Pyx_PyObject_IsTrue(ret); Py_DECREF(ret);
        if (unlikely(b < 0)) return NULL;
        ret = (b) ? Py_False : Py_True;
        Py_INCREF(ret);
      }
      return ret;
    }
    default: {
      return __Pyx_NewRef(Py_NotImplemented);
    }
  }
}

static PyObject *__pyx_getprop_7pyarrow_3lib_12ChunkedArray_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_24equals, METH_O, __pyx_doc_7pyarrow_3lib_12ChunkedArray_23equals},
  {"_to_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_12ChunkedArray_26_to_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_25_to_pandas},
  {"__array__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_12ChunkedArray_28__array__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_27__array__},
  {"dictionary_encode", (PyCFunction)__pyx_pw_7pyarrow_3lib_12ChunkedArray_30dictionary_encode, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_29dictionary_encode},
  {"unique", (PyCFunction)__pyx_pw_7pyarrow_3lib_12ChunkedArray_32unique, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_31unique},
  {"slice", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_12ChunkedArray_34slice, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_33slice},
  {"chunk", (PyCFunction)__pyx_pw_7pyarrow_3lib_12ChunkedArray_36chunk, METH_O, __pyx_doc_7pyarrow_3lib_12ChunkedArray_35chunk},
  {"iterchunks", (PyCFunction)__pyx_pw_7pyarrow_3lib_12ChunkedArray_38iterchunks, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_37iterchunks},
  {"to_pylist", (PyCFunction)__pyx_pw_7pyarrow_3lib_12ChunkedArray_41to_pylist, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_40to_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*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_12ChunkedArray_11__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_ChunkedArray, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_ChunkedArray, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_7pyarrow_3lib_12ChunkedArray_15__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*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*/
  __pyx_tp_richcompare_7pyarrow_3lib_ChunkedArray, /*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
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Column __pyx_vtable_7pyarrow_3lib_Column;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Column(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Column *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib__PandasConvertible(t, a, k);
  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);
  __pyx_tp_dealloc_7pyarrow_3lib__PandasConvertible(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_tp_richcompare_7pyarrow_3lib_Column(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_6Column_25__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_6Column_25__eq__(o1, o2);
      if (likely(ret && ret != Py_NotImplemented)) {
        int b = __Pyx_PyObject_IsTrue(ret); Py_DECREF(ret);
        if (unlikely(b < 0)) return NULL;
        ret = (b) ? Py_False : Py_True;
        Py_INCREF(ret);
      }
      return ret;
    }
    default: {
      return __Pyx_NewRef(Py_NotImplemented);
    }
  }
}

static PyObject *__pyx_getprop_7pyarrow_3lib_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_11from_array, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Column_10from_array},
  {"cast", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Column_13cast, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Column_12cast},
  {"dictionary_encode", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Column_15dictionary_encode, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6Column_14dictionary_encode},
  {"unique", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Column_17unique, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6Column_16unique},
  {"flatten", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Column_19flatten, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Column_18flatten},
  {"_to_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Column_21_to_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Column_20_to_pandas},
  {"__array__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Column_23__array__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Column_22__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_9__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*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_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_tp_richcompare_7pyarrow_3lib_Column, /*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
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Table __pyx_vtable_7pyarrow_3lib_Table;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Table(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Table *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib__PandasConvertible(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Table *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_Table;
  new((void*)&(p->sp_table)) std::shared_ptr< arrow::Table> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_5Table_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_Table(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_Table *p = (struct __pyx_obj_7pyarrow_3lib_Table *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->sp_table);
  __pyx_tp_dealloc_7pyarrow_3lib__PandasConvertible(o);
}
static PyObject *__pyx_sq_item_7pyarrow_3lib_Table(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_tp_richcompare_7pyarrow_3lib_Table(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_5Table_15__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_5Table_15__eq__(o1, o2);
      if (likely(ret && ret != Py_NotImplemented)) {
        int b = __Pyx_PyObject_IsTrue(ret); Py_DECREF(ret);
        if (unlikely(b < 0)) return NULL;
        ret = (b) ? Py_False : Py_True;
        Py_INCREF(ret);
      }
      return ret;
    }
    default: {
      return __Pyx_NewRef(Py_NotImplemented);
    }
  }
}

static PyObject *__pyx_getprop_7pyarrow_3lib_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_17equals, METH_O, __pyx_doc_7pyarrow_3lib_5Table_16equals},
  {"cast", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_19cast, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_18cast},
  {"from_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_21from_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_20from_pandas},
  {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_23from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_22from_arrays},
  {"from_batches", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_25from_batches, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_24from_batches},
  {"to_batches", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_27to_batches, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_26to_batches},
  {"_to_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_29_to_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_28_to_pandas},
  {"to_pydict", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_31to_pydict, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Table_30to_pydict},
  {"column", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_33column, METH_O, __pyx_doc_7pyarrow_3lib_5Table_32column},
  {"_column", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_35_column, METH_O, __pyx_doc_7pyarrow_3lib_5Table_34_column},
  {"itercolumns", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_39itercolumns, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Table_38itercolumns},
  {"add_column", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_44add_column, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_43add_column},
  {"append_column", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_46append_column, METH_O, __pyx_doc_7pyarrow_3lib_5Table_45append_column},
  {"remove_column", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_48remove_column, METH_O, __pyx_doc_7pyarrow_3lib_5Table_47remove_column},
  {"set_column", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_50set_column, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_49set_column},
  {"drop", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_52drop, METH_O, __pyx_doc_7pyarrow_3lib_5Table_51drop},
  {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_42__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_42__len__, /*mp_length*/
  __pyx_pw_7pyarrow_3lib_5Table_37__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Table = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Table", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Table), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Table, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_5Table_5__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_Table, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Table, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "Table()\n\n    A collection of top-level named, equal length Arrow arrays.\n\n    Warning\n    -------\n    Do not call this class's constructor directly, use one of the ``from_*``\n    methods instead.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_Table, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Table, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_Table, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_5Table_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Table, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_RecordBatch __pyx_vtable_7pyarrow_3lib_RecordBatch;

static PyObject *__pyx_tp_new_7pyarrow_3lib_RecordBatch(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_RecordBatch *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib__PandasConvertible(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_RecordBatch;
  new((void*)&(p->sp_batch)) std::shared_ptr< arrow::RecordBatch> ();
  p->_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7pyarrow_3lib_11RecordBatch_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_RecordBatch(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_RecordBatch *p = (struct __pyx_obj_7pyarrow_3lib_RecordBatch *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->sp_batch);
  Py_CLEAR(p->_schema);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib__PandasConvertible(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_RecordBatch(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_RecordBatch *p = (struct __pyx_obj_7pyarrow_3lib_RecordBatch *)o;
  e = ((likely(__pyx_ptype_7pyarrow_3lib__PandasConvertible)) ? ((__pyx_ptype_7pyarrow_3lib__PandasConvertible->tp_traverse) ? __pyx_ptype_7pyarrow_3lib__PandasConvertible->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_3lib_RecordBatch)); if (e) return e;
  if (p->_schema) {
    e = (*v)(((PyObject *)p->_schema), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_RecordBatch(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_RecordBatch *p = (struct __pyx_obj_7pyarrow_3lib_RecordBatch *)o;
  if (likely(__pyx_ptype_7pyarrow_3lib__PandasConvertible)) { if (__pyx_ptype_7pyarrow_3lib__PandasConvertible->tp_clear) __pyx_ptype_7pyarrow_3lib__PandasConvertible->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_3lib_RecordBatch);
  tmp = ((PyObject*)p->_schema);
  p->_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
static PyObject *__pyx_sq_item_7pyarrow_3lib_RecordBatch(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_11RecordBatch_num_columns(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_11RecordBatch_11num_columns_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_11RecordBatch_num_rows(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_11RecordBatch_8num_rows_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_11RecordBatch_schema(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_11RecordBatch_6schema_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_11RecordBatch_columns(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_11RecordBatch_7columns_1__get__(o);
}

static 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_23_to_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11RecordBatch_22_to_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*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_RecordBatch, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_RecordBatch, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "RecordBatch()\n\n    Batch of rows of columns of equal length\n\n    Warning\n    -------\n    Do not call this class's constructor directly, use one of the\n    ``RecordBatch.from_*`` functions instead.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_RecordBatch, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_RecordBatch, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_RecordBatch, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_RecordBatch, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_11RecordBatch_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_RecordBatch, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Buffer __pyx_vtable_7pyarrow_3lib_Buffer;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Buffer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Buffer *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_Buffer;
  new((void*)&(p->buffer)) std::shared_ptr< arrow::Buffer> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_6Buffer_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_Buffer(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_Buffer *p = (struct __pyx_obj_7pyarrow_3lib_Buffer *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->buffer);
  (*Py_TYPE(o)->tp_free)(o);
}
static PyObject *__pyx_sq_item_7pyarrow_3lib_Buffer(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_tp_richcompare_7pyarrow_3lib_Buffer(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_6Buffer_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 *)"\n        The buffer size in bytes.\n        ", 0},
  {(char *)"address", __pyx_getprop_7pyarrow_3lib_6Buffer_address, 0, (char *)"\n        The buffer's address, as an integer.\n        ", 0},
  {(char *)"is_mutable", __pyx_getprop_7pyarrow_3lib_6Buffer_is_mutable, 0, (char *)"\n        Whether the buffer is mutable.\n        ", 0},
  {(char *)"parent", __pyx_getprop_7pyarrow_3lib_6Buffer_parent, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_Buffer = {
  __pyx_pw_7pyarrow_3lib_6Buffer_5__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7pyarrow_3lib_Buffer, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Buffer = {
  __pyx_pw_7pyarrow_3lib_6Buffer_5__len__, /*mp_length*/
  __pyx_pw_7pyarrow_3lib_6Buffer_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*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_Buffer, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Buffer, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Buffer, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "Buffer()\n\n    The base class for all Arrow buffers.\n\n    A buffer represents a contiguous memory area.  Many buffers will own\n    their memory, though not all of them do.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_Buffer, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Buffer, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_Buffer, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_6Buffer_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Buffer, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ResizableBuffer __pyx_vtable_7pyarrow_3lib_ResizableBuffer;

static PyObject *__pyx_tp_new_7pyarrow_3lib_ResizableBuffer(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_ResizableBuffer *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Buffer(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_ResizableBuffer *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Buffer*)__pyx_vtabptr_7pyarrow_3lib_ResizableBuffer;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_ResizableBuffer[] = {
  {"resize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15ResizableBuffer_1resize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15ResizableBuffer_resize},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_ResizableBuffer = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.ResizableBuffer", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_ResizableBuffer), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Buffer, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    A base class for buffers that can be resized.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_ResizableBuffer, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_6Buffer_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_ResizableBuffer, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile __pyx_vtable_7pyarrow_3lib_NativeFile;

static PyObject *__pyx_tp_new_7pyarrow_3lib_NativeFile(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_NativeFile *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_NativeFile;
  new((void*)&(p->input_stream)) std::shared_ptr<arrow::io::InputStream> ();
  new((void*)&(p->random_access)) std::shared_ptr<arrow::io::RandomAccessFile> ();
  new((void*)&(p->output_stream)) std::shared_ptr<arrow::io::OutputStream> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_10NativeFile_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_NativeFile(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_NativeFile *p = (struct __pyx_obj_7pyarrow_3lib_NativeFile *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_7pyarrow_3lib_10NativeFile_3__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  if (p->__weakref__) PyObject_ClearWeakRefs(o);
  __Pyx_call_destructor(p->input_stream);
  __Pyx_call_destructor(p->random_access);
  __Pyx_call_destructor(p->output_stream);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_10NativeFile_mode(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_10NativeFile_4mode_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_10NativeFile_closed(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_10NativeFile_6closed_1__get__(o);
}

static PyObject *__pyx_specialmethod___pyx_pw_7pyarrow_3lib_10NativeFile_53__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_7pyarrow_3lib_10NativeFile_53__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},
  {"_assert_seekable", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_29_assert_seekable, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_28_assert_seekable},
  {"size", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_31size, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_30size},
  {"tell", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_33tell, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_32tell},
  {"seek", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10NativeFile_35seek, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10NativeFile_34seek},
  {"write", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_37write, METH_O, __pyx_doc_7pyarrow_3lib_10NativeFile_36write},
  {"read", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10NativeFile_39read, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10NativeFile_38read},
  {"read1", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10NativeFile_41read1, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10NativeFile_40read1},
  {"readall", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_43readall, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_42readall},
  {"readinto", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_45readinto, METH_O, __pyx_doc_7pyarrow_3lib_10NativeFile_44readinto},
  {"readline", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10NativeFile_47readline, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10NativeFile_46readline},
  {"readlines", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10NativeFile_49readlines, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10NativeFile_48readlines},
  {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7pyarrow_3lib_10NativeFile_53__next__, METH_NOARGS|METH_COEXIST, 0},
  {"read_buffer", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10NativeFile_55read_buffer, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10NativeFile_54read_buffer},
  {"truncate", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_57truncate, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_56truncate},
  {"writelines", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_59writelines, METH_O, __pyx_doc_7pyarrow_3lib_10NativeFile_58writelines},
  {"download", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10NativeFile_61download, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10NativeFile_60download},
  {"upload", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10NativeFile_63upload, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10NativeFile_62upload},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_65__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_64__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_67__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_10NativeFile_66__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_NativeFile[] = {
  {(char *)"mode", __pyx_getprop_7pyarrow_3lib_10NativeFile_mode, 0, (char *)"\n        The file mode. Currently instances of NativeFile may support:\n\n        * rb: binary read\n        * wb: binary write\n        * rb+: binary read and write\n        ", 0},
  {(char *)"closed", __pyx_getprop_7pyarrow_3lib_10NativeFile_closed, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_NativeFile = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.NativeFile", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_NativeFile), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    The base class for all Arrow streams.\n\n    Streams are either readable, writable, or both.\n    They optionally support seeking.\n\n    While this class exposes methods to read or write data from Python, the\n    primary intent of using a Arrow stream is to pass it to other Arrow\n    facilities that will make use of it, such as Arrow IPC routines.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_3lib_10NativeFile_51__iter__, /*tp_iter*/
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__next__, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_NativeFile, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_NativeFile, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_NativeFile, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib__CRecordBatchWriter(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *)o);
  new((void*)&(p->writer)) std::shared_ptr< arrow::ipc::RecordBatchWriter> ();
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib__CRecordBatchWriter(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *p = (struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->writer);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib__CRecordBatchWriter[] = {
  {"write", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_1write, METH_O, __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_write},
  {"write_batch", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_3write_batch, METH_O, __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_2write_batch},
  {"write_table", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_5write_table, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_4write_table},
  {"close", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_7close, METH_NOARGS, __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_6close},
  {"__enter__", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_9__enter__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_8__enter__},
  {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_11__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_10__exit__},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_13__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_12__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_15__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_14__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib__CRecordBatchWriter = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib._CRecordBatchWriter", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib__CRecordBatchWriter, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "The base RecordBatchWriter wrapper.\n\n    Provides common implementations of convenience methods. Should not\n    be instantiated directly by user code.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib__CRecordBatchWriter, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib__CRecordBatchWriter, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib__CRecordBatchReader(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *)o);
  new((void*)&(p->reader)) std::shared_ptr< arrow::RecordBatchReader> ();
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib__CRecordBatchReader(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *p = (struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->reader);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib__CRecordBatchReader[] = {
  {"get_next_batch", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_4get_next_batch, METH_NOARGS, __pyx_doc_7pyarrow_3lib_19_CRecordBatchReader_3get_next_batch},
  {"read_next_batch", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_6read_next_batch, METH_NOARGS, __pyx_doc_7pyarrow_3lib_19_CRecordBatchReader_5read_next_batch},
  {"read_all", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_8read_all, METH_NOARGS, __pyx_doc_7pyarrow_3lib_19_CRecordBatchReader_7read_all},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_10__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_19_CRecordBatchReader_9__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_12__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_19_CRecordBatchReader_11__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib__CRecordBatchReader = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib._CRecordBatchReader", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib__CRecordBatchReader, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "The base RecordBatchReader wrapper.\n\n    Provides common implementations of convenience methods. Should not\n    be instantiated directly by user code.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_1__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib__CRecordBatchReader, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib__CRecordBatchReader, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib__PandasAPIShim __pyx_vtable_7pyarrow_3lib__PandasAPIShim;

static PyObject *__pyx_tp_new_7pyarrow_3lib__PandasAPIShim(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib__PandasAPIShim;
  p->_loose_version = Py_None; Py_INCREF(Py_None);
  p->_version = Py_None; Py_INCREF(Py_None);
  p->_pd = Py_None; Py_INCREF(Py_None);
  p->_types_api = Py_None; Py_INCREF(Py_None);
  p->_compat_module = Py_None; Py_INCREF(Py_None);
  p->_data_frame = Py_None; Py_INCREF(Py_None);
  p->_index = Py_None; Py_INCREF(Py_None);
  p->_series = Py_None; Py_INCREF(Py_None);
  p->_categorical_type = Py_None; Py_INCREF(Py_None);
  p->_datetimetz_type = Py_None; Py_INCREF(Py_None);
  p->_array_like_types = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib__PandasAPIShim(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *p = (struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_loose_version);
  Py_CLEAR(p->_version);
  Py_CLEAR(p->_pd);
  Py_CLEAR(p->_types_api);
  Py_CLEAR(p->_compat_module);
  Py_CLEAR(p->_data_frame);
  Py_CLEAR(p->_index);
  Py_CLEAR(p->_series);
  Py_CLEAR(p->_categorical_type);
  Py_CLEAR(p->_datetimetz_type);
  Py_CLEAR(p->_array_like_types);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib__PandasAPIShim(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *p = (struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)o;
  if (p->_loose_version) {
    e = (*v)(p->_loose_version, a); if (e) return e;
  }
  if (p->_version) {
    e = (*v)(p->_version, a); if (e) return e;
  }
  if (p->_pd) {
    e = (*v)(p->_pd, a); if (e) return e;
  }
  if (p->_types_api) {
    e = (*v)(p->_types_api, a); if (e) return e;
  }
  if (p->_compat_module) {
    e = (*v)(p->_compat_module, a); if (e) return e;
  }
  if (p->_data_frame) {
    e = (*v)(p->_data_frame, a); if (e) return e;
  }
  if (p->_index) {
    e = (*v)(p->_index, a); if (e) return e;
  }
  if (p->_series) {
    e = (*v)(p->_series, a); if (e) return e;
  }
  if (p->_categorical_type) {
    e = (*v)(p->_categorical_type, a); if (e) return e;
  }
  if (p->_datetimetz_type) {
    e = (*v)(p->_datetimetz_type, a); if (e) return e;
  }
  if (p->_array_like_types) {
    e = (*v)(p->_array_like_types, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib__PandasAPIShim(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *p = (struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)o;
  tmp = ((PyObject*)p->_loose_version);
  p->_loose_version = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_version);
  p->_version = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_pd);
  p->_pd = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_types_api);
  p->_types_api = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_compat_module);
  p->_compat_module = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_data_frame);
  p->_data_frame = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_index);
  p->_index = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_series);
  p->_series = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_categorical_type);
  p->_categorical_type = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_datetimetz_type);
  p->_datetimetz_type = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_array_like_types);
  p->_array_like_types = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_have_pandas(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_11have_pandas_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_compat(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_6compat_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_pd(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_2pd_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_loose_version(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_13loose_version_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_version(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_7version_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_categorical_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_16categorical_type_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_datetimetz_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_15datetimetz_type_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__loose_version(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_14_loose_version_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__version(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_8_version_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__pd(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_3_pd_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__types_api(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_10_types_api_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__compat_module(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_14_compat_module_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__data_frame(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_11_data_frame_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__index(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_6_index_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__series(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_7_series_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__categorical_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_17_categorical_type_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__datetimetz_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_16_datetimetz_type_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__array_like_types(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_17_array_like_types_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib__PandasAPIShim[] = {
  {"make_series", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_3make_series, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_2make_series},
  {"data_frame", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_5data_frame, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_4data_frame},
  {"infer_dtype", (PyCFunction)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_7infer_dtype, METH_O, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_6infer_dtype},
  {"is_array_like", (PyCFunction)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_9is_array_like, METH_O, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_8is_array_like},
  {"is_categorical", (PyCFunction)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_11is_categorical, METH_O, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_10is_categorical},
  {"is_datetimetz", (PyCFunction)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_13is_datetimetz, METH_O, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_12is_datetimetz},
  {"is_data_frame", (PyCFunction)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_15is_data_frame, METH_O, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_14is_data_frame},
  {"is_series", (PyCFunction)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_17is_series, METH_O, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_16is_series},
  {"assert_frame_equal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_19assert_frame_equal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_18assert_frame_equal},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_21__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_20__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_23__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_22__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib__PandasAPIShim[] = {
  {(char *)"have_pandas", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_have_pandas, 0, (char *)0, 0},
  {(char *)"compat", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_compat, 0, (char *)0, 0},
  {(char *)"pd", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_pd, 0, (char *)0, 0},
  {(char *)"loose_version", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_loose_version, 0, (char *)0, 0},
  {(char *)"version", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_version, 0, (char *)0, 0},
  {(char *)"categorical_type", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_categorical_type, 0, (char *)0, 0},
  {(char *)"datetimetz_type", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_datetimetz_type, 0, (char *)0, 0},
  {(char *)"_loose_version", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__loose_version, 0, (char *)0, 0},
  {(char *)"_version", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__version, 0, (char *)0, 0},
  {(char *)"_pd", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__pd, 0, (char *)0, 0},
  {(char *)"_types_api", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__types_api, 0, (char *)0, 0},
  {(char *)"_compat_module", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__compat_module, 0, (char *)0, 0},
  {(char *)"_data_frame", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__data_frame, 0, (char *)0, 0},
  {(char *)"_index", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__index, 0, (char *)0, 0},
  {(char *)"_series", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__series, 0, (char *)0, 0},
  {(char *)"_categorical_type", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__categorical_type, 0, (char *)0, 0},
  {(char *)"_datetimetz_type", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__datetimetz_type, 0, (char *)0, 0},
  {(char *)"_array_like_types", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__array_like_types, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib__PandasAPIShim = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib._PandasAPIShim", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib__PandasAPIShim, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "_PandasAPIShim()\n\n    Lazy pandas importer that isolates usages of pandas APIs and avoids\n    importing pandas until it's actually needed\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib__PandasAPIShim, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib__PandasAPIShim, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib__PandasAPIShim, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib__PandasAPIShim, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib__PandasAPIShim, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LoggingMemoryPool __pyx_vtable_7pyarrow_3lib_LoggingMemoryPool;

static PyObject *__pyx_tp_new_7pyarrow_3lib_LoggingMemoryPool(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_MemoryPool(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_MemoryPool*)__pyx_vtabptr_7pyarrow_3lib_LoggingMemoryPool;
  new((void*)&(p->logging_pool)) std::unique_ptr< arrow::LoggingMemoryPool> ();
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_LoggingMemoryPool(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *p = (struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->logging_pool);
  __pyx_tp_dealloc_7pyarrow_3lib_MemoryPool(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_LoggingMemoryPool[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_17LoggingMemoryPool_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_17LoggingMemoryPool_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_17LoggingMemoryPool_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_17LoggingMemoryPool_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_LoggingMemoryPool = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.LoggingMemoryPool", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_LoggingMemoryPool, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "LoggingMemoryPool()", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_LoggingMemoryPool, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_17LoggingMemoryPool_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_LoggingMemoryPool, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ProxyMemoryPool __pyx_vtable_7pyarrow_3lib_ProxyMemoryPool;

static PyObject *__pyx_tp_new_7pyarrow_3lib_ProxyMemoryPool(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_MemoryPool(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_MemoryPool*)__pyx_vtabptr_7pyarrow_3lib_ProxyMemoryPool;
  new((void*)&(p->proxy_pool)) std::unique_ptr< arrow::ProxyMemoryPool> ();
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_ProxyMemoryPool(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *p = (struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->proxy_pool);
  __pyx_tp_dealloc_7pyarrow_3lib_MemoryPool(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_ProxyMemoryPool[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_15ProxyMemoryPool_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_15ProxyMemoryPool_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_15ProxyMemoryPool_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_15ProxyMemoryPool_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_ProxyMemoryPool = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.ProxyMemoryPool", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ProxyMemoryPool, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "ProxyMemoryPool()\n\n    Memory pool implementation that tracks the number of bytes and\n    maximum memory allocated through its direct calls, while redirecting\n    to another memory pool.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_ProxyMemoryPool, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_15ProxyMemoryPool_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_ProxyMemoryPool, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UnionType __pyx_vtable_7pyarrow_3lib_UnionType;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UnionType(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UnionType *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_DataType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UnionType *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_UnionType;
  return o;
}
static PyObject *__pyx_sq_item_7pyarrow_3lib_UnionType(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_9UnionType_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 PyObject *__pyx_getprop_7pyarrow_3lib_9UnionType_type_codes(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_9UnionType_10type_codes_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_UnionType[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_9UnionType_8__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_9UnionType_7__reduce__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_UnionType[] = {
  {(char *)"num_children", __pyx_getprop_7pyarrow_3lib_9UnionType_num_children, 0, (char *)"\n        The number of union members.\n        ", 0},
  {(char *)"mode", __pyx_getprop_7pyarrow_3lib_9UnionType_mode, 0, (char *)"\n        The mode of the union (\"dense\" or \"sparse\").\n        ", 0},
  {(char *)"type_codes", __pyx_getprop_7pyarrow_3lib_9UnionType_type_codes, 0, (char *)"\n        The type code to indicate each data type in this union.\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_UnionType = {
  __pyx_pw_7pyarrow_3lib_9UnionType_1__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7pyarrow_3lib_UnionType, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_UnionType = {
  __pyx_pw_7pyarrow_3lib_9UnionType_1__len__, /*mp_length*/
  __pyx_pw_7pyarrow_3lib_9UnionType_6__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_UnionType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UnionType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UnionType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_UnionType, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_UnionType, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Concrete class for struct data types.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_3lib_9UnionType_3__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_UnionType, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_UnionType, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UnionType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static 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*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_8NullType_3__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Singleton for null array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  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
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BooleanValue __pyx_vtable_7pyarrow_3lib_BooleanValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_BooleanValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_BooleanValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_BooleanValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_BooleanValue;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_BooleanValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_12BooleanValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12BooleanValue_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12BooleanValue_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12BooleanValue_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12BooleanValue_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_12BooleanValue_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_BooleanValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.BooleanValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_BooleanValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for boolean array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_BooleanValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_BooleanValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt8Value __pyx_vtable_7pyarrow_3lib_UInt8Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt8Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt8Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt8Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_UInt8Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_UInt8Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_10UInt8Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10UInt8Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10UInt8Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10UInt8Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10UInt8Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_10UInt8Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt8Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt8Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt8Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for uint8 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_UInt8Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt8Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int16Value __pyx_vtable_7pyarrow_3lib_Int16Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int16Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int16Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int16Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_Int16Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Int16Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int16Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10Int16Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int16Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10Int16Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int16Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_10Int16Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Int16Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int16Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int16Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for int16 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Int16Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int16Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt16Value __pyx_vtable_7pyarrow_3lib_UInt16Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt16Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt16Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt16Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_UInt16Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_UInt16Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt16Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11UInt16Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt16Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11UInt16Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt16Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11UInt16Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt16Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt16Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt16Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for uint16 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_UInt16Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt16Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int32Value __pyx_vtable_7pyarrow_3lib_Int32Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int32Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int32Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int32Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_Int32Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Int32Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int32Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10Int32Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int32Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10Int32Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int32Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_10Int32Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Int32Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int32Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int32Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for int32 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Int32Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int32Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt32Value __pyx_vtable_7pyarrow_3lib_UInt32Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt32Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt32Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt32Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_UInt32Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_UInt32Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt32Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11UInt32Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt32Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11UInt32Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt32Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11UInt32Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt32Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt32Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt32Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for uint32 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_UInt32Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt32Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt64Value __pyx_vtable_7pyarrow_3lib_UInt64Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt64Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt64Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt64Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_UInt64Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_UInt64Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt64Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11UInt64Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt64Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11UInt64Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt64Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11UInt64Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt64Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt64Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt64Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for uint64 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_UInt64Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt64Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Date32Value __pyx_vtable_7pyarrow_3lib_Date32Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Date32Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Date32Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Date32Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_Date32Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Date32Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Date32Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Date32Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Date32Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Date32Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Date32Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11Date32Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Date32Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Date32Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Date32Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for date32 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Date32Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Date32Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Date64Value __pyx_vtable_7pyarrow_3lib_Date64Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Date64Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Date64Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Date64Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_Date64Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Date64Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Date64Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Date64Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Date64Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Date64Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Date64Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11Date64Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Date64Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Date64Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Date64Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for date64 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Date64Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Date64Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Time32Value __pyx_vtable_7pyarrow_3lib_Time32Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Time32Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Time32Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Time32Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_Time32Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Time32Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Time32Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Time32Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Time32Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Time32Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Time32Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11Time32Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Time32Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Time32Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Time32Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for time32 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Time32Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Time32Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Time64Value __pyx_vtable_7pyarrow_3lib_Time64Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Time64Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Time64Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Time64Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_Time64Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Time64Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Time64Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Time64Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Time64Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Time64Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Time64Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11Time64Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Time64Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Time64Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Time64Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for time64 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Time64Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Time64Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_TimestampValue __pyx_vtable_7pyarrow_3lib_TimestampValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_TimestampValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_TimestampValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_TimestampValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_TimestampValue;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14TimestampValue_value(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14TimestampValue_5value_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_TimestampValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_14TimestampValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_14TimestampValue_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14TimestampValue_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_14TimestampValue_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14TimestampValue_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_14TimestampValue_4__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_TimestampValue[] = {
  {(char *)"value", __pyx_getprop_7pyarrow_3lib_14TimestampValue_value, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_TimestampValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.TimestampValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_TimestampValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for timestamp array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_TimestampValue, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_TimestampValue, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_TimestampValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_HalfFloatValue __pyx_vtable_7pyarrow_3lib_HalfFloatValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_HalfFloatValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_HalfFloatValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_HalfFloatValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_HalfFloatValue;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_HalfFloatValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_14HalfFloatValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_14HalfFloatValue_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14HalfFloatValue_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_14HalfFloatValue_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14HalfFloatValue_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_14HalfFloatValue_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_HalfFloatValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.HalfFloatValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_HalfFloatValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for float16 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_HalfFloatValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_HalfFloatValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FloatValue __pyx_vtable_7pyarrow_3lib_FloatValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_FloatValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_FloatValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_FloatValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_FloatValue;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_FloatValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_10FloatValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10FloatValue_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10FloatValue_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10FloatValue_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10FloatValue_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_10FloatValue_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_FloatValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.FloatValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_FloatValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for float32 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_FloatValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_FloatValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DoubleValue __pyx_vtable_7pyarrow_3lib_DoubleValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_DoubleValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_DoubleValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_DoubleValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_DoubleValue;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_DoubleValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11DoubleValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11DoubleValue_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11DoubleValue_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11DoubleValue_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11DoubleValue_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11DoubleValue_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_DoubleValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.DoubleValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_DoubleValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for float64 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_DoubleValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_DoubleValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DecimalValue __pyx_vtable_7pyarrow_3lib_DecimalValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_DecimalValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_DecimalValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_DecimalValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_DecimalValue;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_DecimalValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_12DecimalValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12DecimalValue_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12DecimalValue_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12DecimalValue_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12DecimalValue_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_12DecimalValue_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_DecimalValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.DecimalValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_DecimalValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for decimal128 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_DecimalValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_DecimalValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BinaryValue __pyx_vtable_7pyarrow_3lib_BinaryValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_BinaryValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_BinaryValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_BinaryValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_BinaryValue;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_BinaryValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11BinaryValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11BinaryValue_as_py},
  {"as_buffer", (PyCFunction)__pyx_pw_7pyarrow_3lib_11BinaryValue_3as_buffer, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11BinaryValue_2as_buffer},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11BinaryValue_5__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11BinaryValue_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11BinaryValue_7__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11BinaryValue_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_BinaryValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.BinaryValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_BinaryValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for variable-sized binary array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_BinaryValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_BinaryValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DictionaryValue __pyx_vtable_7pyarrow_3lib_DictionaryValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_DictionaryValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_DictionaryValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_DictionaryValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_DictionaryValue;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15DictionaryValue_index_value(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15DictionaryValue_11index_value_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15DictionaryValue_dictionary_value(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15DictionaryValue_16dictionary_value_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_DictionaryValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_15DictionaryValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_15DictionaryValue_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_15DictionaryValue_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_15DictionaryValue_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_15DictionaryValue_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_15DictionaryValue_4__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_DictionaryValue[] = {
  {(char *)"index_value", __pyx_getprop_7pyarrow_3lib_15DictionaryValue_index_value, 0, (char *)"\n        Return this value's underlying index as a ArrayValue of the right\n        signed integer type.\n        ", 0},
  {(char *)"dictionary_value", __pyx_getprop_7pyarrow_3lib_15DictionaryValue_dictionary_value, 0, (char *)"\n        Return this value's underlying dictionary value as a ArrayValue.\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_DictionaryValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.DictionaryValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_DictionaryValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for dictionary-encoded array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_DictionaryValue, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_DictionaryValue, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_DictionaryValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt8Scalar __pyx_vtable_7pyarrow_3lib_UInt8Scalar;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt8Scalar(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt8Scalar *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ScalarValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt8Scalar *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue*)__pyx_vtabptr_7pyarrow_3lib_UInt8Scalar;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_UInt8Scalar[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt8Scalar_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11UInt8Scalar_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt8Scalar_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11UInt8Scalar_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt8Scalar_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11UInt8Scalar_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt8Scalar = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt8Scalar", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt8Scalar), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for uint8 scalars.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_UInt8Scalar, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt8Scalar, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int8Scalar __pyx_vtable_7pyarrow_3lib_Int8Scalar;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int8Scalar(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int8Scalar *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ScalarValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int8Scalar *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue*)__pyx_vtabptr_7pyarrow_3lib_Int8Scalar;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Int8Scalar[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int8Scalar_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10Int8Scalar_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int8Scalar_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10Int8Scalar_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int8Scalar_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_10Int8Scalar_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Int8Scalar = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int8Scalar", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int8Scalar), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for int8 scalars.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Int8Scalar, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int8Scalar, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt16Scalar __pyx_vtable_7pyarrow_3lib_UInt16Scalar;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt16Scalar(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt16Scalar *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ScalarValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt16Scalar *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue*)__pyx_vtabptr_7pyarrow_3lib_UInt16Scalar;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_UInt16Scalar[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_12UInt16Scalar_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12UInt16Scalar_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12UInt16Scalar_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12UInt16Scalar_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12UInt16Scalar_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_12UInt16Scalar_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt16Scalar = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt16Scalar", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt16Scalar), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for uint16 scalars.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_UInt16Scalar, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt16Scalar, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int16Scalar __pyx_vtable_7pyarrow_3lib_Int16Scalar;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int16Scalar(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int16Scalar *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ScalarValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int16Scalar *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue*)__pyx_vtabptr_7pyarrow_3lib_Int16Scalar;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Int16Scalar[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Int16Scalar_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Int16Scalar_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Int16Scalar_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Int16Scalar_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Int16Scalar_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11Int16Scalar_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Int16Scalar = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int16Scalar", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int16Scalar), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for int16 scalars.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Int16Scalar, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int16Scalar, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt32Scalar __pyx_vtable_7pyarrow_3lib_UInt32Scalar;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt32Scalar(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt32Scalar *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ScalarValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt32Scalar *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue*)__pyx_vtabptr_7pyarrow_3lib_UInt32Scalar;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_UInt32Scalar[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_12UInt32Scalar_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12UInt32Scalar_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12UInt32Scalar_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12UInt32Scalar_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12UInt32Scalar_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_12UInt32Scalar_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt32Scalar = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt32Scalar", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt32Scalar), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for uint32 scalars.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_UInt32Scalar, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt32Scalar, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int32Scalar __pyx_vtable_7pyarrow_3lib_Int32Scalar;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int32Scalar(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int32Scalar *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ScalarValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int32Scalar *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue*)__pyx_vtabptr_7pyarrow_3lib_Int32Scalar;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Int32Scalar[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Int32Scalar_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Int32Scalar_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Int32Scalar_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Int32Scalar_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Int32Scalar_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11Int32Scalar_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Int32Scalar = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int32Scalar", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int32Scalar), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for int32 scalars.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Int32Scalar, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int32Scalar, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt64Scalar __pyx_vtable_7pyarrow_3lib_UInt64Scalar;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt64Scalar(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt64Scalar *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ScalarValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt64Scalar *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue*)__pyx_vtabptr_7pyarrow_3lib_UInt64Scalar;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_UInt64Scalar[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_12UInt64Scalar_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12UInt64Scalar_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12UInt64Scalar_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12UInt64Scalar_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12UInt64Scalar_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_12UInt64Scalar_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt64Scalar = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt64Scalar", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt64Scalar), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for uint64 scalars.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_UInt64Scalar, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt64Scalar, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int64Scalar __pyx_vtable_7pyarrow_3lib_Int64Scalar;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int64Scalar(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int64Scalar *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ScalarValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int64Scalar *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue*)__pyx_vtabptr_7pyarrow_3lib_Int64Scalar;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Int64Scalar[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Int64Scalar_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Int64Scalar_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Int64Scalar_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Int64Scalar_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Int64Scalar_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11Int64Scalar_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Int64Scalar = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int64Scalar", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int64Scalar), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for int64 scalars.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Int64Scalar, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int64Scalar, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FloatScalar __pyx_vtable_7pyarrow_3lib_FloatScalar;

static PyObject *__pyx_tp_new_7pyarrow_3lib_FloatScalar(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_FloatScalar *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ScalarValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_FloatScalar *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue*)__pyx_vtabptr_7pyarrow_3lib_FloatScalar;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_FloatScalar[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11FloatScalar_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11FloatScalar_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11FloatScalar_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11FloatScalar_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11FloatScalar_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11FloatScalar_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_FloatScalar = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.FloatScalar", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_FloatScalar), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for float scalars.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_FloatScalar, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_FloatScalar, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DoubleScalar __pyx_vtable_7pyarrow_3lib_DoubleScalar;

static PyObject *__pyx_tp_new_7pyarrow_3lib_DoubleScalar(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_DoubleScalar *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ScalarValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_DoubleScalar *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue*)__pyx_vtabptr_7pyarrow_3lib_DoubleScalar;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_DoubleScalar[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_12DoubleScalar_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12DoubleScalar_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12DoubleScalar_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12DoubleScalar_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12DoubleScalar_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_12DoubleScalar_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_DoubleScalar = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.DoubleScalar", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_DoubleScalar), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for double scalars.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_DoubleScalar, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_DoubleScalar, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib__FunctionContext(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib__FunctionContext *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib__FunctionContext *)o);
  new((void*)&(p->ctx)) std::unique_ptr< arrow::compute::FunctionContext> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_16_FunctionContext_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib__FunctionContext(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib__FunctionContext *p = (struct __pyx_obj_7pyarrow_3lib__FunctionContext *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->ctx);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib__FunctionContext[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_16_FunctionContext_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16_FunctionContext_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_16_FunctionContext_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_16_FunctionContext_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib__FunctionContext = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib._FunctionContext", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib__FunctionContext), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib__FunctionContext, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib__FunctionContext, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib__FunctionContext, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Date32Array __pyx_vtable_7pyarrow_3lib_Date32Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Date32Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Date32Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NumericArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Date32Array *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_Date32Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_Date32Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Date32Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Date32Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_24__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_28__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of date32 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_21__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Date32Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Date64Array __pyx_vtable_7pyarrow_3lib_Date64Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Date64Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Date64Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NumericArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Date64Array *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_Date64Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_Date64Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Date64Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Date64Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_24__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_28__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of date64 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_21__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Date64Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_TimestampArray __pyx_vtable_7pyarrow_3lib_TimestampArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_TimestampArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_TimestampArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NumericArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_TimestampArray *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_TimestampArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_TimestampArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.TimestampArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_TimestampArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_24__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_28__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of timestamp data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_21__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_TimestampArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Time32Array __pyx_vtable_7pyarrow_3lib_Time32Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Time32Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Time32Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NumericArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Time32Array *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_Time32Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_Time32Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Time32Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Time32Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_24__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_28__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of time32 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_21__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Time32Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Time64Array __pyx_vtable_7pyarrow_3lib_Time64Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Time64Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Time64Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NumericArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Time64Array *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_Time64Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_Time64Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Time64Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Time64Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_24__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_28__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of time64 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_21__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Time64Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib_StringBuilder(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_StringBuilder *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_StringBuilder *)o);
  new((void*)&(p->builder)) std::unique_ptr< arrow::StringBuilder> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_13StringBuilder_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_StringBuilder(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_StringBuilder *p = (struct __pyx_obj_7pyarrow_3lib_StringBuilder *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->builder);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_13StringBuilder_null_count(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_13StringBuilder_10null_count_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_StringBuilder[] = {
  {"append", (PyCFunction)__pyx_pw_7pyarrow_3lib_13StringBuilder_3append, METH_O, __pyx_doc_7pyarrow_3lib_13StringBuilder_2append},
  {"append_values", (PyCFunction)__pyx_pw_7pyarrow_3lib_13StringBuilder_5append_values, METH_O, __pyx_doc_7pyarrow_3lib_13StringBuilder_4append_values},
  {"finish", (PyCFunction)__pyx_pw_7pyarrow_3lib_13StringBuilder_7finish, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13StringBuilder_6finish},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13StringBuilder_11__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13StringBuilder_10__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13StringBuilder_13__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_13StringBuilder_12__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_StringBuilder[] = {
  {(char *)"null_count", __pyx_getprop_7pyarrow_3lib_13StringBuilder_null_count, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_StringBuilder = {
  __pyx_pw_7pyarrow_3lib_13StringBuilder_9__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_StringBuilder = {
  __pyx_pw_7pyarrow_3lib_13StringBuilder_9__len__, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_StringBuilder = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.StringBuilder", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_StringBuilder), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_StringBuilder, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_StringBuilder, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_StringBuilder, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Builder class for UTF8 strings. This class exposes facilities for\n    incrementally adding string values and building the null bitmap\n    for a pyarrow.Array (type='string').\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_StringBuilder, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_StringBuilder, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_StringBuilder, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_PythonFile __pyx_vtable_7pyarrow_3lib_PythonFile;

static PyObject *__pyx_tp_new_7pyarrow_3lib_PythonFile(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_PythonFile *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_PythonFile *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_PythonFile;
  p->handle = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7pyarrow_3lib_10PythonFile_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_PythonFile(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_PythonFile *p = (struct __pyx_obj_7pyarrow_3lib_PythonFile *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->handle);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_PythonFile(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_PythonFile *p = (struct __pyx_obj_7pyarrow_3lib_PythonFile *)o;
  e = ((likely(__pyx_ptype_7pyarrow_3lib_NativeFile)) ? ((__pyx_ptype_7pyarrow_3lib_NativeFile->tp_traverse) ? __pyx_ptype_7pyarrow_3lib_NativeFile->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_3lib_PythonFile)); if (e) return e;
  if (p->handle) {
    e = (*v)(p->handle, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_PythonFile(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_PythonFile *p = (struct __pyx_obj_7pyarrow_3lib_PythonFile *)o;
  if (likely(__pyx_ptype_7pyarrow_3lib_NativeFile)) { if (__pyx_ptype_7pyarrow_3lib_NativeFile->tp_clear) __pyx_ptype_7pyarrow_3lib_NativeFile->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_3lib_PythonFile);
  tmp = ((PyObject*)p->handle);
  p->handle = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_PythonFile[] = {
  {"truncate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10PythonFile_3truncate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10PythonFile_2truncate},
  {"readline", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10PythonFile_5readline, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10PythonFile_4readline},
  {"readlines", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10PythonFile_7readlines, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10PythonFile_6readlines},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10PythonFile_9__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10PythonFile_8__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10PythonFile_11__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_10PythonFile_10__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_PythonFile = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.PythonFile", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_PythonFile), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_PythonFile, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    A stream backed by a Python file object.\n\n    This class allows using Python file objects with arbitrary Arrow\n    functions, including functions written in another language than Python.\n\n    As a downside, there is a non-zero redirection cost in translating\n    Arrow stream calls to Python method calls.  Furthermore, Python's\n    Global Interpreter Lock may limit parallelism in some situations.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_PythonFile, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_PythonFile, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_51__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_PythonFile, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_PythonFile, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_MemoryMappedFile __pyx_vtable_7pyarrow_3lib_MemoryMappedFile;

static PyObject *__pyx_tp_new_7pyarrow_3lib_MemoryMappedFile(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_MemoryMappedFile;
  new((void*)&(p->handle)) std::shared_ptr< arrow::io::MemoryMappedFile> ();
  p->path = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_MemoryMappedFile(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *p = (struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->handle);
  Py_CLEAR(p->path);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_MemoryMappedFile(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *p = (struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *)o;
  e = ((likely(__pyx_ptype_7pyarrow_3lib_NativeFile)) ? ((__pyx_ptype_7pyarrow_3lib_NativeFile->tp_traverse) ? __pyx_ptype_7pyarrow_3lib_NativeFile->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_3lib_MemoryMappedFile)); if (e) return e;
  if (p->path) {
    e = (*v)(p->path, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_MemoryMappedFile(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *p = (struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *)o;
  if (likely(__pyx_ptype_7pyarrow_3lib_NativeFile)) { if (__pyx_ptype_7pyarrow_3lib_NativeFile->tp_clear) __pyx_ptype_7pyarrow_3lib_NativeFile->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_3lib_MemoryMappedFile);
  tmp = ((PyObject*)p->path);
  p->path = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_MemoryMappedFile[] = {
  {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_1create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16MemoryMappedFile_create},
  {"_open", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_3_open, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16MemoryMappedFile_2_open},
  {"resize", (PyCFunction)__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_5resize, METH_O, __pyx_doc_7pyarrow_3lib_16MemoryMappedFile_4resize},
  {"fileno", (PyCFunction)__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_7fileno, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16MemoryMappedFile_6fileno},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_9__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16MemoryMappedFile_8__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_11__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_16MemoryMappedFile_10__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_MemoryMappedFile = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.MemoryMappedFile", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_MemoryMappedFile, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    A stream that represents a memory-mapped file.\n\n    Supports 'r', 'r+', 'w' modes.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_MemoryMappedFile, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_MemoryMappedFile, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_51__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_MemoryMappedFile, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_MemoryMappedFile, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_OSFile __pyx_vtable_7pyarrow_3lib_OSFile;

static PyObject *__pyx_tp_new_7pyarrow_3lib_OSFile(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_OSFile *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_OSFile *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_OSFile;
  p->path = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7pyarrow_3lib_6OSFile_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_OSFile(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_OSFile *p = (struct __pyx_obj_7pyarrow_3lib_OSFile *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->path);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_OSFile(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_OSFile *p = (struct __pyx_obj_7pyarrow_3lib_OSFile *)o;
  e = ((likely(__pyx_ptype_7pyarrow_3lib_NativeFile)) ? ((__pyx_ptype_7pyarrow_3lib_NativeFile->tp_traverse) ? __pyx_ptype_7pyarrow_3lib_NativeFile->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_3lib_OSFile)); if (e) return e;
  if (p->path) {
    e = (*v)(p->path, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_OSFile(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_OSFile *p = (struct __pyx_obj_7pyarrow_3lib_OSFile *)o;
  if (likely(__pyx_ptype_7pyarrow_3lib_NativeFile)) { if (__pyx_ptype_7pyarrow_3lib_NativeFile->tp_clear) __pyx_ptype_7pyarrow_3lib_NativeFile->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_3lib_OSFile);
  tmp = ((PyObject*)p->path);
  p->path = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_OSFile[] = {
  {"fileno", (PyCFunction)__pyx_pw_7pyarrow_3lib_6OSFile_3fileno, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6OSFile_2fileno},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_6OSFile_5__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6OSFile_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_6OSFile_7__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_6OSFile_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_OSFile = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.OSFile", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_OSFile), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_OSFile, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    A stream backed by a regular file descriptor.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_OSFile, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_OSFile, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_51__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_OSFile, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_OSFile, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBufferWriter __pyx_vtable_7pyarrow_3lib_FixedSizeBufferWriter;

static PyObject *__pyx_tp_new_7pyarrow_3lib_FixedSizeBufferWriter(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_FixedSizeBufferWriter;
  if (unlikely(__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_FixedSizeBufferWriter[] = {
  {"set_memcopy_threads", (PyCFunction)__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_3set_memcopy_threads, METH_O, __pyx_doc_7pyarrow_3lib_21FixedSizeBufferWriter_2set_memcopy_threads},
  {"set_memcopy_blocksize", (PyCFunction)__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_5set_memcopy_blocksize, METH_O, __pyx_doc_7pyarrow_3lib_21FixedSizeBufferWriter_4set_memcopy_blocksize},
  {"set_memcopy_threshold", (PyCFunction)__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_7set_memcopy_threshold, METH_O, __pyx_doc_7pyarrow_3lib_21FixedSizeBufferWriter_6set_memcopy_threshold},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_9__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_21FixedSizeBufferWriter_8__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_11__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_21FixedSizeBufferWriter_10__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_FixedSizeBufferWriter = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.FixedSizeBufferWriter", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    A stream writing to a Arrow buffer.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_51__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_FixedSizeBufferWriter, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_FixedSizeBufferWriter, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BufferOutputStream __pyx_vtable_7pyarrow_3lib_BufferOutputStream;

static PyObject *__pyx_tp_new_7pyarrow_3lib_BufferOutputStream(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_BufferOutputStream;
  new((void*)&(p->buffer)) std::shared_ptr< arrow::ResizableBuffer> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_18BufferOutputStream_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_BufferOutputStream(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *p = (struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->buffer);
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_BufferOutputStream[] = {
  {"getvalue", (PyCFunction)__pyx_pw_7pyarrow_3lib_18BufferOutputStream_3getvalue, METH_NOARGS, __pyx_doc_7pyarrow_3lib_18BufferOutputStream_2getvalue},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_18BufferOutputStream_5__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_18BufferOutputStream_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_18BufferOutputStream_7__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_18BufferOutputStream_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_BufferOutputStream = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.BufferOutputStream", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_BufferOutputStream), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_BufferOutputStream, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_51__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_BufferOutputStream, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_BufferOutputStream, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_MockOutputStream __pyx_vtable_7pyarrow_3lib_MockOutputStream;

static PyObject *__pyx_tp_new_7pyarrow_3lib_MockOutputStream(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_MockOutputStream *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_MockOutputStream *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_MockOutputStream;
  if (unlikely(__pyx_pw_7pyarrow_3lib_16MockOutputStream_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_MockOutputStream[] = {
  {"size", (PyCFunction)__pyx_pw_7pyarrow_3lib_16MockOutputStream_3size, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16MockOutputStream_2size},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_16MockOutputStream_5__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16MockOutputStream_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_16MockOutputStream_7__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_16MockOutputStream_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_MockOutputStream = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.MockOutputStream", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_MockOutputStream), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_51__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_MockOutputStream, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_MockOutputStream, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BufferReader __pyx_vtable_7pyarrow_3lib_BufferReader;

static PyObject *__pyx_tp_new_7pyarrow_3lib_BufferReader(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_BufferReader *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_BufferReader *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_BufferReader;
  p->buffer = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7pyarrow_3lib_12BufferReader_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_BufferReader(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_BufferReader *p = (struct __pyx_obj_7pyarrow_3lib_BufferReader *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->buffer);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_BufferReader(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_BufferReader *p = (struct __pyx_obj_7pyarrow_3lib_BufferReader *)o;
  e = ((likely(__pyx_ptype_7pyarrow_3lib_NativeFile)) ? ((__pyx_ptype_7pyarrow_3lib_NativeFile->tp_traverse) ? __pyx_ptype_7pyarrow_3lib_NativeFile->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_3lib_BufferReader)); if (e) return e;
  if (p->buffer) {
    e = (*v)(((PyObject *)p->buffer), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_BufferReader(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_BufferReader *p = (struct __pyx_obj_7pyarrow_3lib_BufferReader *)o;
  if (likely(__pyx_ptype_7pyarrow_3lib_NativeFile)) { if (__pyx_ptype_7pyarrow_3lib_NativeFile->tp_clear) __pyx_ptype_7pyarrow_3lib_NativeFile->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_3lib_BufferReader);
  tmp = ((PyObject*)p->buffer);
  p->buffer = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_BufferReader[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12BufferReader_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12BufferReader_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12BufferReader_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_12BufferReader_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_BufferReader = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.BufferReader", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_BufferReader), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_BufferReader, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Zero-copy reader from objects convertible to Arrow buffer\n\n    Parameters\n    ----------\n    obj : Python bytes or pyarrow.Buffer\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_BufferReader, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_BufferReader, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_51__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_BufferReader, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_BufferReader, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_CompressedInputStream __pyx_vtable_7pyarrow_3lib_CompressedInputStream;

static PyObject *__pyx_tp_new_7pyarrow_3lib_CompressedInputStream(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_CompressedInputStream *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_CompressedInputStream *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_CompressedInputStream;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_CompressedInputStream[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_21CompressedInputStream_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_21CompressedInputStream_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_21CompressedInputStream_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_21CompressedInputStream_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_CompressedInputStream = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.CompressedInputStream", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_CompressedInputStream), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "CompressedInputStream(NativeFile stream, compression)\n\n    An input stream wrapper which decompresses data on the fly.\n\n    Parameters\n    ----------\n    stream : pa.NativeFile\n    compression : str\n        The compression type (\"bz2\", \"brotli\", \"gzip\", \"lz4\", \"snappy\"\n        or \"zstd\")\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_51__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_CompressedInputStream, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_21CompressedInputStream_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_CompressedInputStream, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_CompressedOutputStream __pyx_vtable_7pyarrow_3lib_CompressedOutputStream;

static PyObject *__pyx_tp_new_7pyarrow_3lib_CompressedOutputStream(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_CompressedOutputStream;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_CompressedOutputStream[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_22CompressedOutputStream_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_22CompressedOutputStream_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_22CompressedOutputStream_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_22CompressedOutputStream_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_CompressedOutputStream = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.CompressedOutputStream", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "CompressedOutputStream(NativeFile stream, compression)\n\n    An output stream wrapper which compresses data on the fly.\n\n    Parameters\n    ----------\n    stream : pa.NativeFile\n    compression : str\n        The compression type (\"bz2\", \"brotli\", \"gzip\", \"lz4\", \"snappy\"\n        or \"zstd\")\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_51__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_CompressedOutputStream, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_22CompressedOutputStream_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_CompressedOutputStream, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BufferedInputStream __pyx_vtable_7pyarrow_3lib_BufferedInputStream;

static PyObject *__pyx_tp_new_7pyarrow_3lib_BufferedInputStream(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_BufferedInputStream;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_BufferedInputStream[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_19BufferedInputStream_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_19BufferedInputStream_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_19BufferedInputStream_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_19BufferedInputStream_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_BufferedInputStream = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.BufferedInputStream", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_BufferedInputStream), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "BufferedInputStream(NativeFile stream, int buffer_size, MemoryPool memory_pool=None)", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_51__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_BufferedInputStream, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_19BufferedInputStream_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_BufferedInputStream, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BufferedOutputStream __pyx_vtable_7pyarrow_3lib_BufferedOutputStream;

static PyObject *__pyx_tp_new_7pyarrow_3lib_BufferedOutputStream(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_BufferedOutputStream;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_BufferedOutputStream[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_20BufferedOutputStream_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_20BufferedOutputStream_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_20BufferedOutputStream_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_20BufferedOutputStream_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_BufferedOutputStream = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.BufferedOutputStream", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "BufferedOutputStream(NativeFile stream, int buffer_size, MemoryPool memory_pool=None)", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_51__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_BufferedOutputStream, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_20BufferedOutputStream_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_BufferedOutputStream, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem __pyx_vtable_7pyarrow_3lib_HadoopFileSystem;

static PyObject *__pyx_tp_new_7pyarrow_3lib_HadoopFileSystem(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_HadoopFileSystem;
  new((void*)&(p->client)) std::shared_ptr< arrow::io::HadoopFileSystem> ();
  p->host = Py_None; Py_INCREF(Py_None);
  p->user = Py_None; Py_INCREF(Py_None);
  p->kerb_ticket = Py_None; Py_INCREF(Py_None);
  p->driver = Py_None; Py_INCREF(Py_None);
  p->extra_conf = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_HadoopFileSystem(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *p = (struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_7pyarrow_3lib_16HadoopFileSystem_5__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  __Pyx_call_destructor(p->client);
  Py_CLEAR(p->host);
  Py_CLEAR(p->user);
  Py_CLEAR(p->kerb_ticket);
  Py_CLEAR(p->driver);
  Py_CLEAR(p->extra_conf);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_HadoopFileSystem(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *p = (struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)o;
  if (p->host) {
    e = (*v)(p->host, a); if (e) return e;
  }
  if (p->user) {
    e = (*v)(p->user, a); if (e) return e;
  }
  if (p->kerb_ticket) {
    e = (*v)(p->kerb_ticket, a); if (e) return e;
  }
  if (p->driver) {
    e = (*v)(p->driver, a); if (e) return e;
  }
  if (p->extra_conf) {
    e = (*v)(p->extra_conf, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_HadoopFileSystem(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *p = (struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)o;
  tmp = ((PyObject*)p->host);
  p->host = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->user);
  p->user = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->kerb_ticket);
  p->kerb_ticket = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->driver);
  p->driver = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->extra_conf);
  p->extra_conf = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_is_open(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_16HadoopFileSystem_7is_open_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_host(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_16HadoopFileSystem_4host_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_user(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_16HadoopFileSystem_4user_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_kerb_ticket(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_16HadoopFileSystem_11kerb_ticket_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_driver(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_16HadoopFileSystem_6driver_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_port(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_16HadoopFileSystem_4port_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_extra_conf(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_16HadoopFileSystem_10extra_conf_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_HadoopFileSystem[] = {
  {"_connect", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_1_connect, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem__connect},
  {"connect", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_3connect, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_2connect},
  {"close", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_7close, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_6close},
  {"exists", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_9exists, METH_O, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_8exists},
  {"isdir", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_11isdir, METH_O, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_10isdir},
  {"isfile", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_13isfile, METH_O, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_12isfile},
  {"get_capacity", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_15get_capacity, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_14get_capacity},
  {"get_space_used", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_17get_space_used, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_16get_space_used},
  {"df", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_19df, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_18df},
  {"rename", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_21rename, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_20rename},
  {"info", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_23info, METH_O, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_22info},
  {"stat", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_25stat, METH_O, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_24stat},
  {"ls", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_27ls, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_26ls},
  {"chmod", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_29chmod, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_28chmod},
  {"chown", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_31chown, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_30chown},
  {"mkdir", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_33mkdir, METH_O, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_32mkdir},
  {"delete", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_35delete, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_34delete},
  {"open", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_37open, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_36open},
  {"download", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_39download, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_38download},
  {"upload", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_41upload, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_40upload},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_43__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_42__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_45__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_44__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_HadoopFileSystem[] = {
  {(char *)"is_open", __pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_is_open, 0, (char *)0, 0},
  {(char *)"host", __pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_host, 0, (char *)0, 0},
  {(char *)"user", __pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_user, 0, (char *)0, 0},
  {(char *)"kerb_ticket", __pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_kerb_ticket, 0, (char *)0, 0},
  {(char *)"driver", __pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_driver, 0, (char *)0, 0},
  {(char *)"port", __pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_port, 0, (char *)0, 0},
  {(char *)"extra_conf", __pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_extra_conf, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_HadoopFileSystem = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.HadoopFileSystem", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_HadoopFileSystem, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_HadoopFileSystem, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_HadoopFileSystem, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_HadoopFileSystem, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_HadoopFileSystem, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_HadoopFileSystem, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib__HdfsFileNanny(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *)o);
  p->client = Py_None; Py_INCREF(Py_None);
  p->file_handle_ref = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7pyarrow_3lib_14_HdfsFileNanny_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib__HdfsFileNanny(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *p = (struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_7pyarrow_3lib_14_HdfsFileNanny_3__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->client);
  Py_CLEAR(p->file_handle_ref);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib__HdfsFileNanny(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *p = (struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *)o;
  if (p->client) {
    e = (*v)(p->client, a); if (e) return e;
  }
  if (p->file_handle_ref) {
    e = (*v)(p->file_handle_ref, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib__HdfsFileNanny(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *p = (struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *)o;
  tmp = ((PyObject*)p->client);
  p->client = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->file_handle_ref);
  p->file_handle_ref = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib__HdfsFileNanny[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14_HdfsFileNanny_5__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_14_HdfsFileNanny_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14_HdfsFileNanny_7__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_14_HdfsFileNanny_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib__HdfsFileNanny = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib._HdfsFileNanny", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib__HdfsFileNanny, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib__HdfsFileNanny, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib__HdfsFileNanny, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib__HdfsFileNanny, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib__HdfsFileNanny, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_HdfsFile __pyx_vtable_7pyarrow_3lib_HdfsFile;

static PyObject *__pyx_tp_new_7pyarrow_3lib_HdfsFile(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_HdfsFile *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_HdfsFile *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_HdfsFile;
  p->mode = Py_None; Py_INCREF(Py_None);
  p->parent = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_HdfsFile(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_HdfsFile *p = (struct __pyx_obj_7pyarrow_3lib_HdfsFile *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_7pyarrow_3lib_8HdfsFile_1__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->mode);
  Py_CLEAR(p->parent);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_HdfsFile(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_HdfsFile *p = (struct __pyx_obj_7pyarrow_3lib_HdfsFile *)o;
  e = ((likely(__pyx_ptype_7pyarrow_3lib_NativeFile)) ? ((__pyx_ptype_7pyarrow_3lib_NativeFile->tp_traverse) ? __pyx_ptype_7pyarrow_3lib_NativeFile->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_3lib_HdfsFile)); if (e) return e;
  if (p->mode) {
    e = (*v)(p->mode, a); if (e) return e;
  }
  if (p->parent) {
    e = (*v)(p->parent, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_HdfsFile(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_HdfsFile *p = (struct __pyx_obj_7pyarrow_3lib_HdfsFile *)o;
  if (likely(__pyx_ptype_7pyarrow_3lib_NativeFile)) { if (__pyx_ptype_7pyarrow_3lib_NativeFile->tp_clear) __pyx_ptype_7pyarrow_3lib_NativeFile->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_3lib_HdfsFile);
  tmp = ((PyObject*)p->mode);
  p->mode = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->parent);
  p->parent = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_8HdfsFile_buffer_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_8HdfsFile_11buffer_size_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_8HdfsFile_mode(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_8HdfsFile_4mode_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_8HdfsFile_parent(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_8HdfsFile_6parent_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_HdfsFile[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_8HdfsFile_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_8HdfsFile_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_8HdfsFile_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_8HdfsFile_4__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_HdfsFile[] = {
  {(char *)"buffer_size", __pyx_getprop_7pyarrow_3lib_8HdfsFile_buffer_size, 0, (char *)0, 0},
  {(char *)"mode", __pyx_getprop_7pyarrow_3lib_8HdfsFile_mode, 0, (char *)0, 0},
  {(char *)"parent", __pyx_getprop_7pyarrow_3lib_8HdfsFile_parent, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_HdfsFile = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.HdfsFile", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_HdfsFile), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_HdfsFile, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_HdfsFile, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_HdfsFile, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_51__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_HdfsFile, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_HdfsFile, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_HdfsFile, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib_MessageReader(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_MessageReader *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_MessageReader *)o);
  new((void*)&(p->reader)) std::unique_ptr< arrow::ipc::MessageReader> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_13MessageReader_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_MessageReader(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_MessageReader *p = (struct __pyx_obj_7pyarrow_3lib_MessageReader *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->reader);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_MessageReader[] = {
  {"open_stream", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_13MessageReader_5open_stream, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_13MessageReader_4open_stream},
  {"read_next_message", (PyCFunction)__pyx_pw_7pyarrow_3lib_13MessageReader_10read_next_message, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13MessageReader_9read_next_message},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13MessageReader_12__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13MessageReader_11__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13MessageReader_14__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_13MessageReader_13__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_MessageReader = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.MessageReader", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_MessageReader), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_MessageReader, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "MessageReader()\n\n    Interface for reading Message objects from some source (like an\n    InputStream)\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_3lib_13MessageReader_7__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_MessageReader, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_13MessageReader_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_MessageReader, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib__RecordBatchStreamWriter(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib__CRecordBatchWriter(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *)o);
  new((void*)&(p->sink)) std::shared_ptr<arrow::io::OutputStream> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib__RecordBatchStreamWriter(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *p = (struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_3__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  __Pyx_call_destructor(p->sink);
  __pyx_tp_dealloc_7pyarrow_3lib__CRecordBatchWriter(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib__RecordBatchStreamWriter[] = {
  {"_open", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_5_open, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamWriter_4_open},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_7__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamWriter_6__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_9__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamWriter_8__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib__RecordBatchStreamWriter = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib._RecordBatchStreamWriter", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib__RecordBatchStreamWriter, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib__RecordBatchStreamWriter, /*tp_methods*/
  0, /*tp_members*/
  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__RecordBatchStreamWriter, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib__RecordBatchStreamReader(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib__CRecordBatchReader(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *)o);
  new((void*)&(p->in_stream)) std::shared_ptr<arrow::io::InputStream> ();
  p->schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib__RecordBatchStreamReader(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *p = (struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->in_stream);
  Py_CLEAR(p->schema);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib__CRecordBatchReader(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib__RecordBatchStreamReader(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *p = (struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *)o;
  e = ((likely(__pyx_ptype_7pyarrow_3lib__CRecordBatchReader)) ? ((__pyx_ptype_7pyarrow_3lib__CRecordBatchReader->tp_traverse) ? __pyx_ptype_7pyarrow_3lib__CRecordBatchReader->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_3lib__RecordBatchStreamReader)); if (e) return e;
  if (p->schema) {
    e = (*v)(((PyObject *)p->schema), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib__RecordBatchStreamReader(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *p = (struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *)o;
  if (likely(__pyx_ptype_7pyarrow_3lib__CRecordBatchReader)) { if (__pyx_ptype_7pyarrow_3lib__CRecordBatchReader->tp_clear) __pyx_ptype_7pyarrow_3lib__CRecordBatchReader->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_3lib__RecordBatchStreamReader);
  tmp = ((PyObject*)p->schema);
  p->schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_24_RecordBatchStreamReader_schema(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_6schema_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib__RecordBatchStreamReader[] = {
  {"_open", (PyCFunction)__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_3_open, METH_O, __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamReader_2_open},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_5__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamReader_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_7__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamReader_6__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib__RecordBatchStreamReader[] = {
  {(char *)"schema", __pyx_getprop_7pyarrow_3lib_24_RecordBatchStreamReader_schema, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib__RecordBatchStreamReader = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib._RecordBatchStreamReader", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib__RecordBatchStreamReader, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib__RecordBatchStreamReader, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib__RecordBatchStreamReader, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_1__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib__RecordBatchStreamReader, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib__RecordBatchStreamReader, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib__RecordBatchStreamReader, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib__RecordBatchFileWriter(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_tp_new_7pyarrow_3lib__RecordBatchStreamWriter(t, a, k);
  if (unlikely(!o)) return 0;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib__RecordBatchFileWriter[] = {
  {"_open", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_22_RecordBatchFileWriter_1_open, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_22_RecordBatchFileWriter__open},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_22_RecordBatchFileWriter_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_22_RecordBatchFileWriter_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_22_RecordBatchFileWriter_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_22_RecordBatchFileWriter_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib__RecordBatchFileWriter = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib._RecordBatchFileWriter", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib__RecordBatchFileWriter), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib__RecordBatchStreamWriter, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib__RecordBatchFileWriter, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib__RecordBatchFileWriter, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib__RecordBatchFileReader(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *)o);
  new((void*)&(p->reader)) std::shared_ptr< arrow::ipc::RecordBatchFileReader> ();
  new((void*)&(p->file)) std::shared_ptr<arrow::io::RandomAccessFile> ();
  p->schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib__RecordBatchFileReader(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *p = (struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->reader);
  __Pyx_call_destructor(p->file);
  Py_CLEAR(p->schema);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib__RecordBatchFileReader(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *p = (struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *)o;
  if (p->schema) {
    e = (*v)(((PyObject *)p->schema), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib__RecordBatchFileReader(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *p = (struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *)o;
  tmp = ((PyObject*)p->schema);
  p->schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_22_RecordBatchFileReader_num_record_batches(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_18num_record_batches_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_22_RecordBatchFileReader_schema(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_6schema_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib__RecordBatchFileReader[] = {
  {"_open", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_3_open, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_22_RecordBatchFileReader_2_open},
  {"get_batch", (PyCFunction)__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_5get_batch, METH_O, __pyx_doc_7pyarrow_3lib_22_RecordBatchFileReader_4get_batch},
  {"read_all", (PyCFunction)__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_7read_all, METH_NOARGS, __pyx_doc_7pyarrow_3lib_22_RecordBatchFileReader_6read_all},
  {"__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*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib__RecordBatchFileReader, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib__RecordBatchFileReader, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib__RecordBatchFileReader, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib__RecordBatchFileReader, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib__RecordBatchFileReader, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib_FeatherWriter(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_FeatherWriter *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_FeatherWriter *)o);
  new((void*)&(p->writer)) std::unique_ptr< arrow::ipc::feather::TableWriter> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_13FeatherWriter_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_FeatherWriter(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_FeatherWriter *p = (struct __pyx_obj_7pyarrow_3lib_FeatherWriter *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->writer);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_13FeatherWriter_num_rows(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_13FeatherWriter_8num_rows_1__get__(o);
}

static int __pyx_setprop_7pyarrow_3lib_13FeatherWriter_num_rows(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7pyarrow_3lib_13FeatherWriter_8num_rows_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_FeatherWriter[] = {
  {"open", (PyCFunction)__pyx_pw_7pyarrow_3lib_13FeatherWriter_3open, METH_O, __pyx_doc_7pyarrow_3lib_13FeatherWriter_2open},
  {"close", (PyCFunction)__pyx_pw_7pyarrow_3lib_13FeatherWriter_5close, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13FeatherWriter_4close},
  {"write_array", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_13FeatherWriter_7write_array, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_13FeatherWriter_6write_array},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13FeatherWriter_9__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13FeatherWriter_8__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13FeatherWriter_11__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_13FeatherWriter_10__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_FeatherWriter[] = {
  {(char *)"num_rows", __pyx_getprop_7pyarrow_3lib_13FeatherWriter_num_rows, __pyx_setprop_7pyarrow_3lib_13FeatherWriter_num_rows, (char *)"num_rows: 'int64_t'", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_FeatherWriter = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.FeatherWriter", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_FeatherWriter), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_FeatherWriter, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_FeatherWriter, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_FeatherWriter, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_FeatherWriter, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib_FeatherReader(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_FeatherReader *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_FeatherReader *)o);
  new((void*)&(p->reader)) std::unique_ptr< arrow::ipc::feather::TableReader> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_13FeatherReader_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_FeatherReader(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_FeatherReader *p = (struct __pyx_obj_7pyarrow_3lib_FeatherReader *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->reader);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_13FeatherReader_num_rows(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_13FeatherReader_8num_rows_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_13FeatherReader_num_columns(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_13FeatherReader_11num_columns_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_FeatherReader[] = {
  {"open", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_13FeatherReader_3open, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_13FeatherReader_2open},
  {"get_column_name", (PyCFunction)__pyx_pw_7pyarrow_3lib_13FeatherReader_5get_column_name, METH_O, __pyx_doc_7pyarrow_3lib_13FeatherReader_4get_column_name},
  {"get_column", (PyCFunction)__pyx_pw_7pyarrow_3lib_13FeatherReader_7get_column, METH_O, __pyx_doc_7pyarrow_3lib_13FeatherReader_6get_column},
  {"_read", (PyCFunction)__pyx_pw_7pyarrow_3lib_13FeatherReader_9_read, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13FeatherReader_8_read},
  {"_read_indices", (PyCFunction)__pyx_pw_7pyarrow_3lib_13FeatherReader_11_read_indices, METH_O, __pyx_doc_7pyarrow_3lib_13FeatherReader_10_read_indices},
  {"_read_names", (PyCFunction)__pyx_pw_7pyarrow_3lib_13FeatherReader_13_read_names, METH_O, __pyx_doc_7pyarrow_3lib_13FeatherReader_12_read_names},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13FeatherReader_15__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13FeatherReader_14__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13FeatherReader_17__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_13FeatherReader_16__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_FeatherReader[] = {
  {(char *)"num_rows", __pyx_getprop_7pyarrow_3lib_13FeatherReader_num_rows, 0, (char *)0, 0},
  {(char *)"num_columns", __pyx_getprop_7pyarrow_3lib_13FeatherReader_num_columns, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_FeatherReader = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.FeatherReader", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_FeatherReader), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_FeatherReader, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_FeatherReader, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_FeatherReader, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_FeatherReader, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib_SerializationContext(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_SerializationContext *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)o);
  p->type_to_type_id = Py_None; Py_INCREF(Py_None);
  p->whitelisted_types = Py_None; Py_INCREF(Py_None);
  p->types_to_pickle = Py_None; Py_INCREF(Py_None);
  p->custom_serializers = Py_None; Py_INCREF(Py_None);
  p->custom_deserializers = Py_None; Py_INCREF(Py_None);
  p->pickle_serializer = Py_None; Py_INCREF(Py_None);
  p->pickle_deserializer = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_SerializationContext(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_SerializationContext *p = (struct __pyx_obj_7pyarrow_3lib_SerializationContext *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->type_to_type_id);
  Py_CLEAR(p->whitelisted_types);
  Py_CLEAR(p->types_to_pickle);
  Py_CLEAR(p->custom_serializers);
  Py_CLEAR(p->custom_deserializers);
  Py_CLEAR(p->pickle_serializer);
  Py_CLEAR(p->pickle_deserializer);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_SerializationContext(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_SerializationContext *p = (struct __pyx_obj_7pyarrow_3lib_SerializationContext *)o;
  if (p->type_to_type_id) {
    e = (*v)(p->type_to_type_id, a); if (e) return e;
  }
  if (p->whitelisted_types) {
    e = (*v)(p->whitelisted_types, a); if (e) return e;
  }
  if (p->types_to_pickle) {
    e = (*v)(p->types_to_pickle, a); if (e) return e;
  }
  if (p->custom_serializers) {
    e = (*v)(p->custom_serializers, a); if (e) return e;
  }
  if (p->custom_deserializers) {
    e = (*v)(p->custom_deserializers, a); if (e) return e;
  }
  if (p->pickle_serializer) {
    e = (*v)(p->pickle_serializer, a); if (e) return e;
  }
  if (p->pickle_deserializer) {
    e = (*v)(p->pickle_deserializer, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_SerializationContext(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_SerializationContext *p = (struct __pyx_obj_7pyarrow_3lib_SerializationContext *)o;
  tmp = ((PyObject*)p->type_to_type_id);
  p->type_to_type_id = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->whitelisted_types);
  p->whitelisted_types = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->types_to_pickle);
  p->types_to_pickle = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->custom_serializers);
  p->custom_serializers = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->custom_deserializers);
  p->custom_deserializers = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->pickle_serializer);
  p->pickle_serializer = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->pickle_deserializer);
  p->pickle_deserializer = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_SerializationContext[] = {
  {"set_pickle", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_20SerializationContext_3set_pickle, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_20SerializationContext_2set_pickle},
  {"clone", (PyCFunction)__pyx_pw_7pyarrow_3lib_20SerializationContext_5clone, METH_NOARGS, __pyx_doc_7pyarrow_3lib_20SerializationContext_4clone},
  {"register_type", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_20SerializationContext_7register_type, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_20SerializationContext_6register_type},
  {"_serialize_callback", (PyCFunction)__pyx_pw_7pyarrow_3lib_20SerializationContext_9_serialize_callback, METH_O, __pyx_doc_7pyarrow_3lib_20SerializationContext_8_serialize_callback},
  {"_deserialize_callback", (PyCFunction)__pyx_pw_7pyarrow_3lib_20SerializationContext_11_deserialize_callback, METH_O, __pyx_doc_7pyarrow_3lib_20SerializationContext_10_deserialize_callback},
  {"serialize", (PyCFunction)__pyx_pw_7pyarrow_3lib_20SerializationContext_13serialize, METH_O, __pyx_doc_7pyarrow_3lib_20SerializationContext_12serialize},
  {"serialize_to", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_20SerializationContext_15serialize_to, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_20SerializationContext_14serialize_to},
  {"deserialize", (PyCFunction)__pyx_pw_7pyarrow_3lib_20SerializationContext_17deserialize, METH_O, __pyx_doc_7pyarrow_3lib_20SerializationContext_16deserialize},
  {"deserialize_components", (PyCFunction)__pyx_pw_7pyarrow_3lib_20SerializationContext_19deserialize_components, METH_O, __pyx_doc_7pyarrow_3lib_20SerializationContext_18deserialize_components},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_20SerializationContext_21__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_20SerializationContext_20__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_20SerializationContext_23__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_20SerializationContext_22__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_SerializationContext = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.SerializationContext", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_SerializationContext), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_SerializationContext, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "SerializationContext()", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_SerializationContext, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_SerializationContext, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_SerializationContext, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_20SerializationContext_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_SerializationContext, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_SerializedPyObject __pyx_vtable_7pyarrow_3lib_SerializedPyObject;

static PyObject *__pyx_tp_new_7pyarrow_3lib_SerializedPyObject(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_SerializedPyObject;
  new((void*)&(p->data))  arrow::py::SerializedPyObject();
  p->base = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_SerializedPyObject(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *p = (struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->data);
  Py_CLEAR(p->base);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_SerializedPyObject(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *p = (struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *)o;
  if (p->base) {
    e = (*v)(p->base, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_SerializedPyObject(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *p = (struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *)o;
  tmp = ((PyObject*)p->base);
  p->base = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_18SerializedPyObject_total_bytes(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_18SerializedPyObject_11total_bytes_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_18SerializedPyObject_base(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_18SerializedPyObject_4base_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_SerializedPyObject[] = {
  {"write_to", (PyCFunction)__pyx_pw_7pyarrow_3lib_18SerializedPyObject_1write_to, METH_O, __pyx_doc_7pyarrow_3lib_18SerializedPyObject_write_to},
  {"deserialize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_18SerializedPyObject_3deserialize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_18SerializedPyObject_2deserialize},
  {"to_buffer", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_18SerializedPyObject_5to_buffer, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_18SerializedPyObject_4to_buffer},
  {"from_components", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_18SerializedPyObject_7from_components, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_18SerializedPyObject_6from_components},
  {"to_components", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_18SerializedPyObject_9to_components, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_18SerializedPyObject_8to_components},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_18SerializedPyObject_11__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_18SerializedPyObject_10__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_18SerializedPyObject_13__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_18SerializedPyObject_12__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_SerializedPyObject[] = {
  {(char *)"total_bytes", __pyx_getprop_7pyarrow_3lib_18SerializedPyObject_total_bytes, 0, (char *)0, 0},
  {(char *)"base", __pyx_getprop_7pyarrow_3lib_18SerializedPyObject_base, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_SerializedPyObject = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.SerializedPyObject", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_SerializedPyObject, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Arrow-serialized representation of Python object\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_SerializedPyObject, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_SerializedPyObject, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_SerializedPyObject, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_SerializedPyObject, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_SerializedPyObject, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct____iter__[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct____iter__ = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct____iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct____iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct____iter__[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct____iter__];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct____iter__(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct____iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct____iter__[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct____iter__++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct____iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct____iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct____iter__", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct____iter__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct____iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct____iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__ *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_1___iter__[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_1___iter__ = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_1___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_1___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_1___iter__[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_1___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_1___iter__(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_1___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_1___iter__[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_1___iter__++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_1___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_1___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_1___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_1___iter__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_1___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_1___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__ *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_2___iter__[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_2___iter__ = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_2___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_2___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_2___iter__[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_2___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_2___iter__(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_2___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_2___iter__[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_2___iter__++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_2___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_2___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_2___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_2___iter__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_2___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_2___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_pd);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions *)o;
  if (p->__pyx_v_pd) {
    e = (*v)(p->__pyx_v_pd, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions *)o;
  tmp = ((PyObject*)p->__pyx_v_pd);
  p->__pyx_v_pd = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4___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*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_4___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
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__ *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_5___iter__[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_5___iter__ = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_5___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_5___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_5___iter__[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_5___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_5___iter__(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_5___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_5___iter__[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_5___iter__++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_5___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_5___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_5___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_5___iter__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_5___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_5___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__ *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_6___iter__[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_6___iter__ = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_6___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_6___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_6___iter__[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_6___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_6___iter__(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_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_6___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_6___iter__[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_6___iter__++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_6___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__ *)o;
  if (p->__pyx_v_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_6___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_6___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_6___iter__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_6___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_6___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7_iterchunks *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_7_iterchunks[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_7_iterchunks = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_7_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_7_iterchunks > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7_iterchunks)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_7_iterchunks[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_7_iterchunks];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7_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_7_iterchunks(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7_iterchunks *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7_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_7_iterchunks < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7_iterchunks)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_7_iterchunks[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_7_iterchunks++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7_iterchunks *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_7_iterchunks(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7_iterchunks *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7_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_7_iterchunks = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_7_iterchunks", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7_iterchunks), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_7_iterchunks, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_7_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_7_iterchunks, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_itercolumns *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_8_itercolumns[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_8_itercolumns = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_8_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_8_itercolumns > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_itercolumns)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_8_itercolumns[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_8_itercolumns];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_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_8_itercolumns(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_itercolumns *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_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_8_itercolumns < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_itercolumns)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_8_itercolumns[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_8_itercolumns++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_itercolumns *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_8_itercolumns(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_itercolumns *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_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_8_itercolumns = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_8_itercolumns", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_itercolumns), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_8_itercolumns, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_8_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_8_itercolumns, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_download *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_9_download[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_9_download = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_9_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_9_download > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_download)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_9_download[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_9_download];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_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_9_download(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_download *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_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_9_download < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_download)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_9_download[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_9_download++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_download *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_9_download(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_download *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_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_9_download(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_download *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_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_9_download = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_9_download", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_download), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_9_download, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_9_download, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib___pyx_scope_struct_9_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_9_download, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_upload *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_10_upload[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_10_upload = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_10_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_10_upload > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_upload)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_10_upload[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_10_upload];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_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_10_upload(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_upload *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_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_10_upload < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_upload)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_10_upload[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_10_upload++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_upload *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_10_upload(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_upload *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_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_10_upload(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_upload *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_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_10_upload = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_10_upload", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10_upload), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_10_upload, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_10_upload, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib___pyx_scope_struct_10_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_10_upload, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_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*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_11___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
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12___iter__ *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_12___iter__[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_12___iter__ = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_12___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_12___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12___iter__)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_12___iter__[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_12___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12___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_12___iter__(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12___iter__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_12___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12___iter__)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_12___iter__[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_12___iter__++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_12___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12___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_12___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_12___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_12___iter__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_12___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_12___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13_is_named_tuple *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_13_is_named_tuple[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_13_is_named_tuple = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_13_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_13_is_named_tuple > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13_is_named_tuple)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_13_is_named_tuple[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_13_is_named_tuple];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13_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_13_is_named_tuple(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13_is_named_tuple *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13_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_13_is_named_tuple < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13_is_named_tuple)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_13_is_named_tuple[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_13_is_named_tuple++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13_is_named_tuple *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_13_is_named_tuple(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13_is_named_tuple *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13_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_13_is_named_tuple(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13_is_named_tuple *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13_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_13_is_named_tuple = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_13_is_named_tuple", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13_is_named_tuple), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_13_is_named_tuple, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_13_is_named_tuple, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib___pyx_scope_struct_13_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_13_is_named_tuple, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_genexpr *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_14_genexpr[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_14_genexpr = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_14_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_14_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_14_genexpr[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_14_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_14_genexpr(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_n);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_14_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_genexpr)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_14_genexpr[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_14_genexpr++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_14_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_n) {
    e = (*v)(p->__pyx_v_n, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_14_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_14_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_14_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_14_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_14_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {"decimal128", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_61decimal128, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_60decimal128},
  {"list_", (PyCFunction)__pyx_pw_7pyarrow_3lib_69list_, METH_O, __pyx_doc_7pyarrow_3lib_68list_},
  {"dictionary", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_71dictionary, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_70dictionary},
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec_lib(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_lib},
  {0, NULL}
};
#endif

static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    "lib",
    0, /* m_doc */
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    0, /* m_size */
  #else
    -1, /* m_size */
  #endif
    __pyx_methods /* m_methods */,
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    __pyx_moduledef_slots, /* m_slots */
  #else
    NULL, /* m_reload */
  #endif
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
    #define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
    #define CYTHON_SMALL_CODE __attribute__((cold))
#else
    #define CYTHON_SMALL_CODE
#endif
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_u_02d_02d, __pyx_k_02d_02d, sizeof(__pyx_k_02d_02d), 0, 1, 0, 0},
  {&__pyx_kp_u_0_0_9_1_0_9_2_0_3_0_5_0_9, __pyx_k_0_0_9_1_0_9_2_0_3_0_5_0_9, sizeof(__pyx_k_0_0_9_1_0_9_2_0_3_0_5_0_9), 0, 1, 0, 0},
  {&__pyx_kp_u_0_1, __pyx_k_0_1, sizeof(__pyx_k_0_1), 0, 1, 0, 0},
  {&__pyx_kp_u_0_19_0, __pyx_k_0_19_0, sizeof(__pyx_k_0_19_0), 0, 1, 0, 0},
  {&__pyx_kp_u_0_20_0, __pyx_k_0_20_0, sizeof(__pyx_k_0_20_0), 0, 1, 0, 0},
  {&__pyx_kp_u_0___class_____name___0, __pyx_k_0___class_____name___0, sizeof(__pyx_k_0___class_____name___0), 0, 1, 0, 0},
  {&__pyx_kp_u_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, 1, 0, 0},
  {&__pyx_n_s_Array, __pyx_k_Array, sizeof(__pyx_k_Array), 0, 0, 1, 1},
  {&__pyx_n_s_ArrayValue, __pyx_k_ArrayValue, sizeof(__pyx_k_ArrayValue), 0, 0, 1, 1},
  {&__pyx_n_s_Array___iter, __pyx_k_Array___iter, sizeof(__pyx_k_Array___iter), 0, 0, 1, 1},
  {&__pyx_kp_u_Array_cast_line_417, __pyx_k_Array_cast_line_417, sizeof(__pyx_k_Array_cast_line_417), 0, 1, 0, 0},
  {&__pyx_kp_u_Array_data_type_was_NULL, __pyx_k_Array_data_type_was_NULL, sizeof(__pyx_k_Array_data_type_was_NULL), 0, 1, 0, 0},
  {&__pyx_kp_u_Array_was_NULL, __pyx_k_Array_was_NULL, sizeof(__pyx_k_Array_was_NULL), 0, 1, 0, 0},
  {&__pyx_kp_u_Arrays_were_not_all_the_same_len, __pyx_k_Arrays_were_not_all_the_same_len, sizeof(__pyx_k_Arrays_were_not_all_the_same_len), 0, 1, 0, 0},
  {&__pyx_n_s_ArrowCapacityError, __pyx_k_ArrowCapacityError, sizeof(__pyx_k_ArrowCapacityError), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowException, __pyx_k_ArrowException, sizeof(__pyx_k_ArrowException), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowIOError, __pyx_k_ArrowIOError, sizeof(__pyx_k_ArrowIOError), 0, 0, 1, 1},
  {&__pyx_n_s_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_n_s_BaseTzInfo, __pyx_k_BaseTzInfo, sizeof(__pyx_k_BaseTzInfo), 0, 0, 1, 1},
  {&__pyx_kp_u_Batch_number_0_out_of_range, __pyx_k_Batch_number_0_out_of_range, sizeof(__pyx_k_Batch_number_0_out_of_range), 0, 1, 0, 0},
  {&__pyx_n_s_BinaryArray, __pyx_k_BinaryArray, sizeof(__pyx_k_BinaryArray), 0, 0, 1, 1},
  {&__pyx_n_s_BinaryValue, __pyx_k_BinaryValue, sizeof(__pyx_k_BinaryValue), 0, 0, 1, 1},
  {&__pyx_n_s_BooleanArray, __pyx_k_BooleanArray, sizeof(__pyx_k_BooleanArray), 0, 0, 1, 1},
  {&__pyx_n_s_BooleanValue, __pyx_k_BooleanValue, sizeof(__pyx_k_BooleanValue), 0, 0, 1, 1},
  {&__pyx_n_s_Buffer, __pyx_k_Buffer, sizeof(__pyx_k_Buffer), 0, 0, 1, 1},
  {&__pyx_n_s_BufferError, __pyx_k_BufferError, sizeof(__pyx_k_BufferError), 0, 0, 1, 1},
  {&__pyx_n_s_BufferOutputStream, __pyx_k_BufferOutputStream, sizeof(__pyx_k_BufferOutputStream), 0, 0, 1, 1},
  {&__pyx_n_s_BufferReader, __pyx_k_BufferReader, sizeof(__pyx_k_BufferReader), 0, 0, 1, 1},
  {&__pyx_kp_u_Buffer_size_must_be_larger_than, __pyx_k_Buffer_size_must_be_larger_than, sizeof(__pyx_k_Buffer_size_must_be_larger_than), 0, 1, 0, 0},
  {&__pyx_n_s_BufferedIOBase, __pyx_k_BufferedIOBase, sizeof(__pyx_k_BufferedIOBase), 0, 0, 1, 1},
  {&__pyx_n_s_BufferedInputStream, __pyx_k_BufferedInputStream, sizeof(__pyx_k_BufferedInputStream), 0, 0, 1, 1},
  {&__pyx_n_s_BufferedOutputStream, __pyx_k_BufferedOutputStream, sizeof(__pyx_k_BufferedOutputStream), 0, 0, 1, 1},
  {&__pyx_kp_u_CPU_count_must_be_strictly_posit, __pyx_k_CPU_count_must_be_strictly_posit, sizeof(__pyx_k_CPU_count_must_be_strictly_posit), 0, 1, 0, 0},
  {&__pyx_n_s_CRecordBatchReader, __pyx_k_CRecordBatchReader, sizeof(__pyx_k_CRecordBatchReader), 0, 0, 1, 1},
  {&__pyx_n_s_CRecordBatchReader___iter, __pyx_k_CRecordBatchReader___iter, sizeof(__pyx_k_CRecordBatchReader___iter), 0, 0, 1, 1},
  {&__pyx_n_s_CRecordBatchWriter, __pyx_k_CRecordBatchWriter, sizeof(__pyx_k_CRecordBatchWriter), 0, 0, 1, 1},
  {&__pyx_kp_u_Cannot_compare_Arrow_values_that, __pyx_k_Cannot_compare_Arrow_values_that, sizeof(__pyx_k_Cannot_compare_Arrow_values_that), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_compare_scalars_that_don, __pyx_k_Cannot_compare_scalars_that_don, sizeof(__pyx_k_Cannot_compare_scalars_that_don), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_construct_a_chunked_array, __pyx_k_Cannot_construct_a_chunked_array, sizeof(__pyx_k_Cannot_construct_a_chunked_array), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_convert_nanosecond_timest, __pyx_k_Cannot_convert_nanosecond_timest, sizeof(__pyx_k_Cannot_convert_nanosecond_timest), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_create_multiple_NAType_in, __pyx_k_Cannot_create_multiple_NAType_in, sizeof(__pyx_k_Cannot_create_multiple_NAType_in), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_pass_schema_and_arrays, __pyx_k_Cannot_pass_schema_and_arrays, sizeof(__pyx_k_Cannot_pass_schema_and_arrays), 0, 1, 0, 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_u_Chunk_index_out_of_range, __pyx_k_Chunk_index_out_of_range, sizeof(__pyx_k_Chunk_index_out_of_range), 0, 1, 0, 0},
  {&__pyx_n_s_ChunkedArray, __pyx_k_ChunkedArray, sizeof(__pyx_k_ChunkedArray), 0, 0, 1, 1},
  {&__pyx_n_s_ChunkedArray___iter, __pyx_k_ChunkedArray___iter, sizeof(__pyx_k_ChunkedArray___iter), 0, 0, 1, 1},
  {&__pyx_kp_u_ChunkedArray_data_type_was_NULL, __pyx_k_ChunkedArray_data_type_was_NULL, sizeof(__pyx_k_ChunkedArray_data_type_was_NULL), 0, 1, 0, 0},
  {&__pyx_n_s_ChunkedArray_iterchunks, __pyx_k_ChunkedArray_iterchunks, sizeof(__pyx_k_ChunkedArray_iterchunks), 0, 0, 1, 1},
  {&__pyx_kp_u_ChunkedArray_was_NULL, __pyx_k_ChunkedArray_was_NULL, sizeof(__pyx_k_ChunkedArray_was_NULL), 0, 1, 0, 0},
  {&__pyx_n_s_Column, __pyx_k_Column, sizeof(__pyx_k_Column), 0, 0, 1, 1},
  {&__pyx_kp_u_Column_does_not_exist_in_table, __pyx_k_Column_does_not_exist_in_table, sizeof(__pyx_k_Column_does_not_exist_in_table), 0, 1, 0, 0},
  {&__pyx_kp_u_Column_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, 1, 0, 0},
  {&__pyx_kp_u_Column_r_not_found, __pyx_k_Column_r_not_found, sizeof(__pyx_k_Column_r_not_found), 0, 1, 0, 0},
  {&__pyx_kp_u_Comparisons_with_pyarrow_Array_a, __pyx_k_Comparisons_with_pyarrow_Array_a, sizeof(__pyx_k_Comparisons_with_pyarrow_Array_a), 0, 1, 0, 0},
  {&__pyx_n_s_CompressedInputStream, __pyx_k_CompressedInputStream, sizeof(__pyx_k_CompressedInputStream), 0, 0, 1, 1},
  {&__pyx_n_s_CompressedOutputStream, __pyx_k_CompressedOutputStream, sizeof(__pyx_k_CompressedOutputStream), 0, 0, 1, 1},
  {&__pyx_kp_u_Convert_pandas_DataFrame_to_an, __pyx_k_Convert_pandas_DataFrame_to_an, sizeof(__pyx_k_Convert_pandas_DataFrame_to_an), 0, 1, 0, 0},
  {&__pyx_kp_u_Create_pyarrow_Array_instance_f, __pyx_k_Create_pyarrow_Array_instance_f, sizeof(__pyx_k_Create_pyarrow_Array_instance_f), 0, 1, 0, 0},
  {&__pyx_n_s_DEFAULT_BUFFER_SIZE, __pyx_k_DEFAULT_BUFFER_SIZE, sizeof(__pyx_k_DEFAULT_BUFFER_SIZE), 0, 0, 1, 1},
  {&__pyx_n_s_DataFrame, __pyx_k_DataFrame, sizeof(__pyx_k_DataFrame), 0, 0, 1, 1},
  {&__pyx_n_s_DataType, __pyx_k_DataType, sizeof(__pyx_k_DataType), 0, 0, 1, 1},
  {&__pyx_kp_u_DataType_expected_got_r, __pyx_k_DataType_expected_got_r, sizeof(__pyx_k_DataType_expected_got_r), 0, 1, 0, 0},
  {&__pyx_n_s_Date32Array, __pyx_k_Date32Array, sizeof(__pyx_k_Date32Array), 0, 0, 1, 1},
  {&__pyx_n_s_Date32Value, __pyx_k_Date32Value, sizeof(__pyx_k_Date32Value), 0, 0, 1, 1},
  {&__pyx_n_s_Date64Array, __pyx_k_Date64Array, sizeof(__pyx_k_Date64Array), 0, 0, 1, 1},
  {&__pyx_n_s_Date64Value, __pyx_k_Date64Value, sizeof(__pyx_k_Date64Value), 0, 0, 1, 1},
  {&__pyx_n_s_DatetimeTZDtype, __pyx_k_DatetimeTZDtype, sizeof(__pyx_k_DatetimeTZDtype), 0, 0, 1, 1},
  {&__pyx_n_s_Decimal, __pyx_k_Decimal, sizeof(__pyx_k_Decimal), 0, 0, 1, 1},
  {&__pyx_n_s_Decimal128Array, __pyx_k_Decimal128Array, sizeof(__pyx_k_Decimal128Array), 0, 0, 1, 1},
  {&__pyx_n_s_Decimal128Type, __pyx_k_Decimal128Type, sizeof(__pyx_k_Decimal128Type), 0, 0, 1, 1},
  {&__pyx_n_s_DecimalValue, __pyx_k_DecimalValue, sizeof(__pyx_k_DecimalValue), 0, 0, 1, 1},
  {&__pyx_n_s_DeserializationCallbackError, __pyx_k_DeserializationCallbackError, sizeof(__pyx_k_DeserializationCallbackError), 0, 0, 1, 1},
  {&__pyx_n_s_DeserializationCallbackError___i, __pyx_k_DeserializationCallbackError___i, sizeof(__pyx_k_DeserializationCallbackError___i), 0, 0, 1, 1},
  {&__pyx_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_u_Do_not_call_Buffer_s_constructor, __pyx_k_Do_not_call_Buffer_s_constructor, sizeof(__pyx_k_Do_not_call_Buffer_s_constructor), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_ChunkedArray_s_const, __pyx_k_Do_not_call_ChunkedArray_s_const, sizeof(__pyx_k_Do_not_call_ChunkedArray_s_const), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_Column_s_constructor, __pyx_k_Do_not_call_Column_s_constructor, sizeof(__pyx_k_Do_not_call_Column_s_constructor), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_Field_s_constructor, __pyx_k_Do_not_call_Field_s_constructor, sizeof(__pyx_k_Do_not_call_Field_s_constructor), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_RecordBatch_s_constr, __pyx_k_Do_not_call_RecordBatch_s_constr, sizeof(__pyx_k_Do_not_call_RecordBatch_s_constr), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_Schema_s_constructor, __pyx_k_Do_not_call_Schema_s_constructor, sizeof(__pyx_k_Do_not_call_Schema_s_constructor), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_Table_s_constructor, __pyx_k_Do_not_call_Table_s_constructor, sizeof(__pyx_k_Do_not_call_Table_s_constructor), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_Tensor_s_constructor, __pyx_k_Do_not_call_Tensor_s_constructor, sizeof(__pyx_k_Do_not_call_Tensor_s_constructor), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_s_constructor_direct, __pyx_k_Do_not_call_s_constructor_direct, sizeof(__pyx_k_Do_not_call_s_constructor_direct), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_s_constructor_direct_2, __pyx_k_Do_not_call_s_constructor_direct_2, sizeof(__pyx_k_Do_not_call_s_constructor_direct_2), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_s_constructor_direct_3, __pyx_k_Do_not_call_s_constructor_direct_3, sizeof(__pyx_k_Do_not_call_s_constructor_direct_3), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_s_constructor_direct_4, __pyx_k_Do_not_call_s_constructor_direct_4, sizeof(__pyx_k_Do_not_call_s_constructor_direct_4), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_s_constructor_direct_5, __pyx_k_Do_not_call_s_constructor_direct_5, sizeof(__pyx_k_Do_not_call_s_constructor_direct_5), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_s_constructor_direct_6, __pyx_k_Do_not_call_s_constructor_direct_6, sizeof(__pyx_k_Do_not_call_s_constructor_direct_6), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_s_constructor_direct_7, __pyx_k_Do_not_call_s_constructor_direct_7, sizeof(__pyx_k_Do_not_call_s_constructor_direct_7), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_s_constructor_direct_8, __pyx_k_Do_not_call_s_constructor_direct_8, sizeof(__pyx_k_Do_not_call_s_constructor_direct_8), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_s_constructor_direct_9, __pyx_k_Do_not_call_s_constructor_direct_9, sizeof(__pyx_k_Do_not_call_s_constructor_direct_9), 0, 1, 0, 0},
  {&__pyx_n_s_DoubleArray, __pyx_k_DoubleArray, sizeof(__pyx_k_DoubleArray), 0, 0, 1, 1},
  {&__pyx_n_s_DoubleScalar, __pyx_k_DoubleScalar, sizeof(__pyx_k_DoubleScalar), 0, 0, 1, 1},
  {&__pyx_n_s_DoubleValue, __pyx_k_DoubleValue, sizeof(__pyx_k_DoubleValue), 0, 0, 1, 1},
  {&__pyx_n_s_Empty, __pyx_k_Empty, sizeof(__pyx_k_Empty), 0, 0, 1, 1},
  {&__pyx_kp_u_Expected_integer_or_string_index, __pyx_k_Expected_integer_or_string_index, sizeof(__pyx_k_Expected_integer_or_string_index), 0, 1, 0, 0},
  {&__pyx_n_s_FIXED_OFFSET_RE, __pyx_k_FIXED_OFFSET_RE, sizeof(__pyx_k_FIXED_OFFSET_RE), 0, 0, 1, 1},
  {&__pyx_kp_u_Failed_to_allocate_0_bytes, __pyx_k_Failed_to_allocate_0_bytes, sizeof(__pyx_k_Failed_to_allocate_0_bytes), 0, 1, 0, 0},
  {&__pyx_n_s_FeatherError, __pyx_k_FeatherError, sizeof(__pyx_k_FeatherError), 0, 0, 1, 1},
  {&__pyx_n_s_FeatherReader, __pyx_k_FeatherReader, sizeof(__pyx_k_FeatherReader), 0, 0, 1, 1},
  {&__pyx_n_s_FeatherWriter, __pyx_k_FeatherWriter, sizeof(__pyx_k_FeatherWriter), 0, 0, 1, 1},
  {&__pyx_n_s_Field, __pyx_k_Field, sizeof(__pyx_k_Field), 0, 0, 1, 1},
  {&__pyx_kp_u_File_object_is_malformed_has_no, __pyx_k_File_object_is_malformed_has_no, sizeof(__pyx_k_File_object_is_malformed_has_no), 0, 1, 0, 0},
  {&__pyx_n_s_FixedOffset, __pyx_k_FixedOffset, sizeof(__pyx_k_FixedOffset), 0, 0, 1, 1},
  {&__pyx_n_s_FixedOffset_2, __pyx_k_FixedOffset_2, sizeof(__pyx_k_FixedOffset_2), 0, 0, 1, 1},
  {&__pyx_n_s_FixedSizeBinaryArray, __pyx_k_FixedSizeBinaryArray, sizeof(__pyx_k_FixedSizeBinaryArray), 0, 0, 1, 1},
  {&__pyx_n_s_FixedSizeBinaryType, __pyx_k_FixedSizeBinaryType, sizeof(__pyx_k_FixedSizeBinaryType), 0, 0, 1, 1},
  {&__pyx_n_s_FixedSizeBinaryValue, __pyx_k_FixedSizeBinaryValue, sizeof(__pyx_k_FixedSizeBinaryValue), 0, 0, 1, 1},
  {&__pyx_n_s_FixedSizeBufferWriter, __pyx_k_FixedSizeBufferWriter, sizeof(__pyx_k_FixedSizeBufferWriter), 0, 0, 1, 1},
  {&__pyx_n_s_FloatArray, __pyx_k_FloatArray, sizeof(__pyx_k_FloatArray), 0, 0, 1, 1},
  {&__pyx_n_s_FloatScalar, __pyx_k_FloatScalar, sizeof(__pyx_k_FloatScalar), 0, 0, 1, 1},
  {&__pyx_n_s_FloatValue, __pyx_k_FloatValue, sizeof(__pyx_k_FloatValue), 0, 0, 1, 1},
  {&__pyx_n_s_FloatingPointArray, __pyx_k_FloatingPointArray, sizeof(__pyx_k_FloatingPointArray), 0, 0, 1, 1},
  {&__pyx_n_s_Full, __pyx_k_Full, sizeof(__pyx_k_Full), 0, 0, 1, 1},
  {&__pyx_n_s_FunctionContext, __pyx_k_FunctionContext, sizeof(__pyx_k_FunctionContext), 0, 0, 1, 1},
  {&__pyx_n_s_FutureWarning, __pyx_k_FutureWarning, sizeof(__pyx_k_FutureWarning), 0, 0, 1, 1},
  {&__pyx_n_b_H, __pyx_k_H, sizeof(__pyx_k_H), 0, 0, 0, 1},
  {&__pyx_n_s_HDFS_PATH_RE, __pyx_k_HDFS_PATH_RE, sizeof(__pyx_k_HDFS_PATH_RE), 0, 0, 1, 1},
  {&__pyx_kp_u_HDFS_client_improperly_initializ, __pyx_k_HDFS_client_improperly_initializ, sizeof(__pyx_k_HDFS_client_improperly_initializ), 0, 1, 0, 0},
  {&__pyx_kp_u_HDFS_client_is_closed, __pyx_k_HDFS_client_is_closed, sizeof(__pyx_k_HDFS_client_is_closed), 0, 1, 0, 0},
  {&__pyx_n_s_HadoopFileSystem, __pyx_k_HadoopFileSystem, sizeof(__pyx_k_HadoopFileSystem), 0, 0, 1, 1},
  {&__pyx_n_s_HalfFloatArray, __pyx_k_HalfFloatArray, sizeof(__pyx_k_HalfFloatArray), 0, 0, 1, 1},
  {&__pyx_n_s_HalfFloatValue, __pyx_k_HalfFloatValue, sizeof(__pyx_k_HalfFloatValue), 0, 0, 1, 1},
  {&__pyx_n_s_HdfsFile, __pyx_k_HdfsFile, sizeof(__pyx_k_HdfsFile), 0, 0, 1, 1},
  {&__pyx_n_s_HdfsFileNanny, __pyx_k_HdfsFileNanny, sizeof(__pyx_k_HdfsFileNanny), 0, 0, 1, 1},
  {&__pyx_n_b_I, __pyx_k_I, sizeof(__pyx_k_I), 0, 0, 0, 1},
  {&__pyx_n_s_IOBase, __pyx_k_IOBase, sizeof(__pyx_k_IOBase), 0, 0, 1, 1},
  {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1},
  {&__pyx_kp_u_I_O_operation_on_closed_file, __pyx_k_I_O_operation_on_closed_file, sizeof(__pyx_k_I_O_operation_on_closed_file), 0, 1, 0, 0},
  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0x01, __pyx_k_Incompatible_checksums_s_vs_0x01, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x01), 0, 0, 1, 0},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0x59, __pyx_k_Incompatible_checksums_s_vs_0x59, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x59), 0, 0, 1, 0},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0x9a, __pyx_k_Incompatible_checksums_s_vs_0x9a, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x9a), 0, 0, 1, 0},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0xd4, __pyx_k_Incompatible_checksums_s_vs_0xd4, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xd4), 0, 0, 1, 0},
  {&__pyx_n_s_Index, __pyx_k_Index, sizeof(__pyx_k_Index), 0, 0, 1, 1},
  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
  {&__pyx_kp_u_Index_must_either_be_string_or_i, __pyx_k_Index_must_either_be_string_or_i, sizeof(__pyx_k_Index_must_either_be_string_or_i), 0, 1, 0, 0},
  {&__pyx_kp_u_Indices_must_be_integer_type, __pyx_k_Indices_must_be_integer_type, sizeof(__pyx_k_Indices_must_be_integer_type), 0, 1, 0, 0},
  {&__pyx_n_s_Int16Array, __pyx_k_Int16Array, sizeof(__pyx_k_Int16Array), 0, 0, 1, 1},
  {&__pyx_n_s_Int16Scalar, __pyx_k_Int16Scalar, sizeof(__pyx_k_Int16Scalar), 0, 0, 1, 1},
  {&__pyx_n_s_Int16Value, __pyx_k_Int16Value, sizeof(__pyx_k_Int16Value), 0, 0, 1, 1},
  {&__pyx_n_s_Int32Array, __pyx_k_Int32Array, sizeof(__pyx_k_Int32Array), 0, 0, 1, 1},
  {&__pyx_n_s_Int32Scalar, __pyx_k_Int32Scalar, sizeof(__pyx_k_Int32Scalar), 0, 0, 1, 1},
  {&__pyx_n_s_Int32Value, __pyx_k_Int32Value, sizeof(__pyx_k_Int32Value), 0, 0, 1, 1},
  {&__pyx_n_s_Int64Array, __pyx_k_Int64Array, sizeof(__pyx_k_Int64Array), 0, 0, 1, 1},
  {&__pyx_n_s_Int64Scalar, __pyx_k_Int64Scalar, sizeof(__pyx_k_Int64Scalar), 0, 0, 1, 1},
  {&__pyx_n_s_Int64Value, __pyx_k_Int64Value, sizeof(__pyx_k_Int64Value), 0, 0, 1, 1},
  {&__pyx_n_s_Int8Array, __pyx_k_Int8Array, sizeof(__pyx_k_Int8Array), 0, 0, 1, 1},
  {&__pyx_n_s_Int8Scalar, __pyx_k_Int8Scalar, sizeof(__pyx_k_Int8Scalar), 0, 0, 1, 1},
  {&__pyx_n_s_Int8Value, __pyx_k_Int8Value, sizeof(__pyx_k_Int8Value), 0, 0, 1, 1},
  {&__pyx_n_s_IntegerArray, __pyx_k_IntegerArray, sizeof(__pyx_k_IntegerArray), 0, 0, 1, 1},
  {&__pyx_kp_u_Invalid_TimeUnit_for_time32, __pyx_k_Invalid_TimeUnit_for_time32, sizeof(__pyx_k_Invalid_TimeUnit_for_time32), 0, 1, 0, 0},
  {&__pyx_kp_u_Invalid_TimeUnit_for_time64, __pyx_k_Invalid_TimeUnit_for_time64, sizeof(__pyx_k_Invalid_TimeUnit_for_time64), 0, 1, 0, 0},
  {&__pyx_kp_u_Invalid_TimeUnit_string, __pyx_k_Invalid_TimeUnit_string, sizeof(__pyx_k_Invalid_TimeUnit_string), 0, 1, 0, 0},
  {&__pyx_kp_u_Invalid_file_mode_0, __pyx_k_Invalid_file_mode_0, sizeof(__pyx_k_Invalid_file_mode_0), 0, 1, 0, 0},
  {&__pyx_kp_u_Invalid_union_mode_0_r, __pyx_k_Invalid_union_mode_0_r, sizeof(__pyx_k_Invalid_union_mode_0_r), 0, 1, 0, 0},
  {&__pyx_kp_u_Invalid_value_for_compression_r, __pyx_k_Invalid_value_for_compression_r, sizeof(__pyx_k_Invalid_value_for_compression_r), 0, 1, 0, 0},
  {&__pyx_kp_u_Invalid_value_of_whence_0, __pyx_k_Invalid_value_of_whence_0, sizeof(__pyx_k_Invalid_value_of_whence_0), 0, 1, 0, 0},
  {&__pyx_n_s_K, __pyx_k_K, sizeof(__pyx_k_K), 0, 0, 1, 1},
  {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
  {&__pyx_kp_u_Length_of_names_does_not_match_l, __pyx_k_Length_of_names_does_not_match_l, sizeof(__pyx_k_Length_of_names_does_not_match_l), 0, 1, 0, 0},
  {&__pyx_n_s_ListArray, __pyx_k_ListArray, sizeof(__pyx_k_ListArray), 0, 0, 1, 1},
  {&__pyx_n_s_ListType, __pyx_k_ListType, sizeof(__pyx_k_ListType), 0, 0, 1, 1},
  {&__pyx_n_s_ListValue, __pyx_k_ListValue, sizeof(__pyx_k_ListValue), 0, 0, 1, 1},
  {&__pyx_n_s_ListValue___iter, __pyx_k_ListValue___iter, sizeof(__pyx_k_ListValue___iter), 0, 0, 1, 1},
  {&__pyx_kp_u_List_requires_DataType_or_Field, __pyx_k_List_requires_DataType_or_Field, sizeof(__pyx_k_List_requires_DataType_or_Field), 0, 1, 0, 0},
  {&__pyx_n_s_LoggingMemoryPool, __pyx_k_LoggingMemoryPool, sizeof(__pyx_k_LoggingMemoryPool), 0, 0, 1, 1},
  {&__pyx_n_s_LooseVersion, __pyx_k_LooseVersion, sizeof(__pyx_k_LooseVersion), 0, 0, 1, 1},
  {&__pyx_n_s_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_kp_u_Metadata_must_be_an_instance_of, __pyx_k_Metadata_must_be_an_instance_of, sizeof(__pyx_k_Metadata_must_be_an_instance_of), 0, 1, 0, 0},
  {&__pyx_n_s_MockOutputStream, __pyx_k_MockOutputStream, sizeof(__pyx_k_MockOutputStream), 0, 0, 1, 1},
  {&__pyx_kp_u_Mode_must_be_rb_read_wb_write_ne, __pyx_k_Mode_must_be_rb_read_wb_write_ne, sizeof(__pyx_k_Mode_must_be_rb_read_wb_write_ne), 0, 1, 0, 0},
  {&__pyx_kp_u_Must_be_an_instance_of_datetime, __pyx_k_Must_be_an_instance_of_datetime, sizeof(__pyx_k_Must_be_an_instance_of_datetime), 0, 1, 0, 0},
  {&__pyx_kp_u_Must_pass_decompressed_size_for, __pyx_k_Must_pass_decompressed_size_for, sizeof(__pyx_k_Must_pass_decompressed_size_for), 0, 1, 0, 0},
  {&__pyx_kp_u_Must_pass_names_when_constructin, __pyx_k_Must_pass_names_when_constructin, sizeof(__pyx_k_Must_pass_names_when_constructin), 0, 1, 0, 0},
  {&__pyx_kp_u_Must_pass_schema_or_at_least_one, __pyx_k_Must_pass_schema_or_at_least_one, sizeof(__pyx_k_Must_pass_schema_or_at_least_one), 0, 1, 0, 0},
  {&__pyx_n_s_NA, __pyx_k_NA, sizeof(__pyx_k_NA), 0, 0, 1, 1},
  {&__pyx_n_s_NAType, __pyx_k_NAType, sizeof(__pyx_k_NAType), 0, 0, 1, 1},
  {&__pyx_n_u_NULL, __pyx_k_NULL, sizeof(__pyx_k_NULL), 0, 1, 0, 1},
  {&__pyx_n_s_NULL_2, __pyx_k_NULL_2, sizeof(__pyx_k_NULL_2), 0, 0, 1, 1},
  {&__pyx_kp_u_Names_are_currently_required, __pyx_k_Names_are_currently_required, sizeof(__pyx_k_Names_are_currently_required), 0, 1, 0, 0},
  {&__pyx_n_s_NativeFile, __pyx_k_NativeFile, sizeof(__pyx_k_NativeFile), 0, 0, 1, 1},
  {&__pyx_kp_u_No_type_alias_for_0, __pyx_k_No_type_alias_for_0, sizeof(__pyx_k_No_type_alias_for_0), 0, 1, 0, 0},
  {&__pyx_kp_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_No_value_specified_for_struct_at_6, __pyx_k_No_value_specified_for_struct_at_6, sizeof(__pyx_k_No_value_specified_for_struct_at_6), 0, 0, 1, 0},
  {&__pyx_kp_u_Non_fixed_width_type, __pyx_k_Non_fixed_width_type, sizeof(__pyx_k_Non_fixed_width_type), 0, 1, 0, 0},
  {&__pyx_n_u_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 1, 0, 1},
  {&__pyx_n_s_NotImplemented, __pyx_k_NotImplemented, sizeof(__pyx_k_NotImplemented), 0, 0, 1, 1},
  {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
  {&__pyx_n_s_NullArray, __pyx_k_NullArray, sizeof(__pyx_k_NullArray), 0, 0, 1, 1},
  {&__pyx_n_s_NullType, __pyx_k_NullType, sizeof(__pyx_k_NullType), 0, 0, 1, 1},
  {&__pyx_kp_u_NumPy_array_view_is_only_support, __pyx_k_NumPy_array_view_is_only_support, sizeof(__pyx_k_NumPy_array_view_is_only_support), 0, 1, 0, 0},
  {&__pyx_kp_u_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, 1, 0, 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_u_Offset_must_be_non_negative, __pyx_k_Offset_must_be_non_negative, sizeof(__pyx_k_Offset_must_be_non_negative), 0, 1, 0, 0},
  {&__pyx_kp_u_Offset_must_represent_whole_numb, __pyx_k_Offset_must_represent_whole_numb, sizeof(__pyx_k_Offset_must_represent_whole_numb), 0, 1, 0, 0},
  {&__pyx_n_s_OrderedDict, __pyx_k_OrderedDict, sizeof(__pyx_k_OrderedDict), 0, 0, 1, 1},
  {&__pyx_n_s_PY3, __pyx_k_PY3, sizeof(__pyx_k_PY3), 0, 0, 1, 1},
  {&__pyx_n_s_PandasAPIShim, __pyx_k_PandasAPIShim, sizeof(__pyx_k_PandasAPIShim), 0, 0, 1, 1},
  {&__pyx_n_s_PandasConvertible, __pyx_k_PandasConvertible, sizeof(__pyx_k_PandasConvertible), 0, 0, 1, 1},
  {&__pyx_kp_u_Passed_field_type_does_not_match, __pyx_k_Passed_field_type_does_not_match, sizeof(__pyx_k_Passed_field_type_does_not_match), 0, 1, 0, 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_u_Please_use_read_next_batch_inste, __pyx_k_Please_use_read_next_batch_inste, sizeof(__pyx_k_Please_use_read_next_batch_inste), 0, 1, 0, 0},
  {&__pyx_n_s_ProxyMemoryPool, __pyx_k_ProxyMemoryPool, sizeof(__pyx_k_ProxyMemoryPool), 0, 0, 1, 1},
  {&__pyx_n_s_PythonFile, __pyx_k_PythonFile, sizeof(__pyx_k_PythonFile), 0, 0, 1, 1},
  {&__pyx_n_b_Q, __pyx_k_Q, sizeof(__pyx_k_Q), 0, 0, 0, 1},
  {&__pyx_n_s_Queue, __pyx_k_Queue, sizeof(__pyx_k_Queue), 0, 0, 1, 1},
  {&__pyx_n_s_QueueEmpty, __pyx_k_QueueEmpty, sizeof(__pyx_k_QueueEmpty), 0, 0, 1, 1},
  {&__pyx_n_s_QueueFull, __pyx_k_QueueFull, sizeof(__pyx_k_QueueFull), 0, 0, 1, 1},
  {&__pyx_n_s_RecordBatch, __pyx_k_RecordBatch, sizeof(__pyx_k_RecordBatch), 0, 0, 1, 1},
  {&__pyx_n_s_RecordBatchFileReader, __pyx_k_RecordBatchFileReader, sizeof(__pyx_k_RecordBatchFileReader), 0, 0, 1, 1},
  {&__pyx_n_s_RecordBatchFileWriter, __pyx_k_RecordBatchFileWriter, sizeof(__pyx_k_RecordBatchFileWriter), 0, 0, 1, 1},
  {&__pyx_n_s_RecordBatchStreamReader, __pyx_k_RecordBatchStreamReader, sizeof(__pyx_k_RecordBatchStreamReader), 0, 0, 1, 1},
  {&__pyx_n_s_RecordBatchStreamWriter, __pyx_k_RecordBatchStreamWriter, sizeof(__pyx_k_RecordBatchStreamWriter), 0, 0, 1, 1},
  {&__pyx_kp_u_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, 1, 0, 0},
  {&__pyx_n_s_ResizableBuffer, __pyx_k_ResizableBuffer, sizeof(__pyx_k_ResizableBuffer), 0, 0, 1, 1},
  {&__pyx_kp_u_Returns_implied_schema_from_dat, __pyx_k_Returns_implied_schema_from_dat, sizeof(__pyx_k_Returns_implied_schema_from_dat), 0, 1, 0, 0},
  {&__pyx_n_s_Scalar, __pyx_k_Scalar, sizeof(__pyx_k_Scalar), 0, 0, 1, 1},
  {&__pyx_n_s_ScalarValue, __pyx_k_ScalarValue, sizeof(__pyx_k_ScalarValue), 0, 0, 1, 1},
  {&__pyx_kp_u_Scalar_data_type_was_NULL, __pyx_k_Scalar_data_type_was_NULL, sizeof(__pyx_k_Scalar_data_type_was_NULL), 0, 1, 0, 0},
  {&__pyx_kp_u_Scalar_was_NULL, __pyx_k_Scalar_was_NULL, sizeof(__pyx_k_Scalar_was_NULL), 0, 1, 0, 0},
  {&__pyx_n_s_Schema, __pyx_k_Schema, sizeof(__pyx_k_Schema), 0, 0, 1, 1},
  {&__pyx_n_s_Schema___iter, __pyx_k_Schema___iter, sizeof(__pyx_k_Schema___iter), 0, 0, 1, 1},
  {&__pyx_kp_u_Schema_and_number_of_arrays_uneq, __pyx_k_Schema_and_number_of_arrays_uneq, sizeof(__pyx_k_Schema_and_number_of_arrays_uneq), 0, 1, 0, 0},
  {&__pyx_kp_u_Schema_field_name_corresponds_to, __pyx_k_Schema_field_name_corresponds_to, sizeof(__pyx_k_Schema_field_name_corresponds_to), 0, 1, 0, 0},
  {&__pyx_kp_u_Schema_from_pandas_line_720, __pyx_k_Schema_from_pandas_line_720, sizeof(__pyx_k_Schema_from_pandas_line_720), 0, 1, 0, 0},
  {&__pyx_n_s_SerializationCallbackError, __pyx_k_SerializationCallbackError, sizeof(__pyx_k_SerializationCallbackError), 0, 0, 1, 1},
  {&__pyx_n_s_SerializationCallbackError___ini, __pyx_k_SerializationCallbackError___ini, sizeof(__pyx_k_SerializationCallbackError___ini), 0, 0, 1, 1},
  {&__pyx_n_s_SerializationContext, __pyx_k_SerializationContext, sizeof(__pyx_k_SerializationContext), 0, 0, 1, 1},
  {&__pyx_n_s_SerializedPyObject, __pyx_k_SerializedPyObject, sizeof(__pyx_k_SerializedPyObject), 0, 0, 1, 1},
  {&__pyx_n_s_Series, __pyx_k_Series, sizeof(__pyx_k_Series), 0, 0, 1, 1},
  {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1},
  {&__pyx_n_s_StringArray, __pyx_k_StringArray, sizeof(__pyx_k_StringArray), 0, 0, 1, 1},
  {&__pyx_n_s_StringBuilder, __pyx_k_StringBuilder, sizeof(__pyx_k_StringBuilder), 0, 0, 1, 1},
  {&__pyx_kp_u_StringBuilder_only_accepts_strin, __pyx_k_StringBuilder_only_accepts_strin, sizeof(__pyx_k_StringBuilder_only_accepts_strin), 0, 1, 0, 0},
  {&__pyx_n_s_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_kp_u_Struct_field_name_corresponds_to, __pyx_k_Struct_field_name_corresponds_to, sizeof(__pyx_k_Struct_field_name_corresponds_to), 0, 1, 0, 0},
  {&__pyx_n_s_SystemError, __pyx_k_SystemError, sizeof(__pyx_k_SystemError), 0, 0, 1, 1},
  {&__pyx_n_s_Table, __pyx_k_Table, sizeof(__pyx_k_Table), 0, 0, 1, 1},
  {&__pyx_kp_u_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, 1, 0, 0},
  {&__pyx_kp_u_Table_from_pandas_line_1087, __pyx_k_Table_from_pandas_line_1087, sizeof(__pyx_k_Table_from_pandas_line_1087), 0, 1, 0, 0},
  {&__pyx_n_s_Table_itercolumns, __pyx_k_Table_itercolumns, sizeof(__pyx_k_Table_itercolumns), 0, 0, 1, 1},
  {&__pyx_kp_u_Target_schema_s_field_names_are, __pyx_k_Target_schema_s_field_names_are, sizeof(__pyx_k_Target_schema_s_field_names_are), 0, 1, 0, 0},
  {&__pyx_n_s_Tensor, __pyx_k_Tensor, sizeof(__pyx_k_Tensor), 0, 0, 1, 1},
  {&__pyx_kp_u_Tensor_was_NULL, __pyx_k_Tensor_was_NULL, sizeof(__pyx_k_Tensor_was_NULL), 0, 1, 0, 0},
  {&__pyx_kp_u_The_number_of_names_should_be_eq, __pyx_k_The_number_of_names_should_be_eq, sizeof(__pyx_k_The_number_of_names_should_be_eq), 0, 1, 0, 0},
  {&__pyx_kp_u_The_type_id_argument_must_be_a_s, __pyx_k_The_type_id_argument_must_be_a_s, sizeof(__pyx_k_The_type_id_argument_must_be_a_s), 0, 1, 0, 0},
  {&__pyx_n_s_Thread, __pyx_k_Thread, sizeof(__pyx_k_Thread), 0, 0, 1, 1},
  {&__pyx_n_s_Time32Array, __pyx_k_Time32Array, sizeof(__pyx_k_Time32Array), 0, 0, 1, 1},
  {&__pyx_n_s_Time32Type, __pyx_k_Time32Type, sizeof(__pyx_k_Time32Type), 0, 0, 1, 1},
  {&__pyx_n_s_Time32Value, __pyx_k_Time32Value, sizeof(__pyx_k_Time32Value), 0, 0, 1, 1},
  {&__pyx_n_s_Time64Array, __pyx_k_Time64Array, sizeof(__pyx_k_Time64Array), 0, 0, 1, 1},
  {&__pyx_n_s_Time64Type, __pyx_k_Time64Type, sizeof(__pyx_k_Time64Type), 0, 0, 1, 1},
  {&__pyx_n_s_Time64Value, __pyx_k_Time64Value, sizeof(__pyx_k_Time64Value), 0, 0, 1, 1},
  {&__pyx_n_s_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_u_Type_ID, __pyx_k_Type_ID, sizeof(__pyx_k_Type_ID), 0, 1, 0, 0},
  {&__pyx_n_s_Type_INT16, __pyx_k_Type_INT16, sizeof(__pyx_k_Type_INT16), 0, 0, 1, 1},
  {&__pyx_n_s_Type_INT32, __pyx_k_Type_INT32, sizeof(__pyx_k_Type_INT32), 0, 0, 1, 1},
  {&__pyx_n_s_Type_INT64, __pyx_k_Type_INT64, sizeof(__pyx_k_Type_INT64), 0, 0, 1, 1},
  {&__pyx_n_s_Type_INT8, __pyx_k_Type_INT8, sizeof(__pyx_k_Type_INT8), 0, 0, 1, 1},
  {&__pyx_n_s_Type_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_UInt16Scalar, __pyx_k_UInt16Scalar, sizeof(__pyx_k_UInt16Scalar), 0, 0, 1, 1},
  {&__pyx_n_s_UInt16Value, __pyx_k_UInt16Value, sizeof(__pyx_k_UInt16Value), 0, 0, 1, 1},
  {&__pyx_n_s_UInt32Array, __pyx_k_UInt32Array, sizeof(__pyx_k_UInt32Array), 0, 0, 1, 1},
  {&__pyx_n_s_UInt32Scalar, __pyx_k_UInt32Scalar, sizeof(__pyx_k_UInt32Scalar), 0, 0, 1, 1},
  {&__pyx_n_s_UInt32Value, __pyx_k_UInt32Value, sizeof(__pyx_k_UInt32Value), 0, 0, 1, 1},
  {&__pyx_n_s_UInt64Array, __pyx_k_UInt64Array, sizeof(__pyx_k_UInt64Array), 0, 0, 1, 1},
  {&__pyx_n_s_UInt64Scalar, __pyx_k_UInt64Scalar, sizeof(__pyx_k_UInt64Scalar), 0, 0, 1, 1},
  {&__pyx_n_s_UInt64Value, __pyx_k_UInt64Value, sizeof(__pyx_k_UInt64Value), 0, 0, 1, 1},
  {&__pyx_n_s_UInt8Array, __pyx_k_UInt8Array, sizeof(__pyx_k_UInt8Array), 0, 0, 1, 1},
  {&__pyx_n_s_UInt8Scalar, __pyx_k_UInt8Scalar, sizeof(__pyx_k_UInt8Scalar), 0, 0, 1, 1},
  {&__pyx_n_s_UInt8Value, __pyx_k_UInt8Value, sizeof(__pyx_k_UInt8Value), 0, 0, 1, 1},
  {&__pyx_kp_u_Unable_to_convert_timezone_to_st, __pyx_k_Unable_to_convert_timezone_to_st, sizeof(__pyx_k_Unable_to_convert_timezone_to_st), 0, 1, 0, 0},
  {&__pyx_kp_u_Unable_to_read_from_object_of_ty, __pyx_k_Unable_to_read_from_object_of_ty, sizeof(__pyx_k_Unable_to_read_from_object_of_ty), 0, 1, 0, 0},
  {&__pyx_kp_u_Unable_to_read_message_from_obje, __pyx_k_Unable_to_read_message_from_obje, sizeof(__pyx_k_Unable_to_read_message_from_obje), 0, 1, 0, 0},
  {&__pyx_kp_u_Unable_to_wrap_Datum_in_a_Python, __pyx_k_Unable_to_wrap_Datum_in_a_Python, sizeof(__pyx_k_Unable_to_wrap_Datum_in_a_Python), 0, 1, 0, 0},
  {&__pyx_n_s_UnionArray, __pyx_k_UnionArray, sizeof(__pyx_k_UnionArray), 0, 0, 1, 1},
  {&__pyx_n_s_UnionMode_DENSE, __pyx_k_UnionMode_DENSE, sizeof(__pyx_k_UnionMode_DENSE), 0, 0, 1, 1},
  {&__pyx_n_s_UnionMode_SPARSE, __pyx_k_UnionMode_SPARSE, sizeof(__pyx_k_UnionMode_SPARSE), 0, 0, 1, 1},
  {&__pyx_n_s_UnionType, __pyx_k_UnionType, sizeof(__pyx_k_UnionType), 0, 0, 1, 1},
  {&__pyx_n_s_UnionType___iter, __pyx_k_UnionType___iter, sizeof(__pyx_k_UnionType___iter), 0, 0, 1, 1},
  {&__pyx_n_s_UnionValue, __pyx_k_UnionValue, sizeof(__pyx_k_UnionValue), 0, 0, 1, 1},
  {&__pyx_kp_u_Unrecognized_compression_type, __pyx_k_Unrecognized_compression_type, sizeof(__pyx_k_Unrecognized_compression_type), 0, 1, 0, 0},
  {&__pyx_n_s_UnsupportedOperation, __pyx_k_UnsupportedOperation, sizeof(__pyx_k_UnsupportedOperation), 0, 0, 1, 1},
  {&__pyx_kp_u_Unsupported_type_for_column, __pyx_k_Unsupported_type_for_column, sizeof(__pyx_k_Unsupported_type_for_column), 0, 1, 0, 0},
  {&__pyx_n_s_UserWarning, __pyx_k_UserWarning, sizeof(__pyx_k_UserWarning), 0, 0, 1, 1},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_kp_u_We_do_not_know_how_to_serialize, __pyx_k_We_do_not_know_how_to_serialize, sizeof(__pyx_k_We_do_not_know_how_to_serialize), 0, 1, 0, 0},
  {&__pyx_kp_u_Writable_buffer_requested_but_Ar, __pyx_k_Writable_buffer_requested_but_Ar, sizeof(__pyx_k_Writable_buffer_requested_but_Ar), 0, 1, 0, 0},
  {&__pyx_kp_u__136, __pyx_k__136, sizeof(__pyx_k__136), 0, 1, 0, 0},
  {&__pyx_kp_b__149, __pyx_k__149, sizeof(__pyx_k__149), 0, 0, 0, 0},
  {&__pyx_kp_u__17, __pyx_k__17, sizeof(__pyx_k__17), 0, 1, 0, 0},
  {&__pyx_kp_u__18, __pyx_k__18, sizeof(__pyx_k__18), 0, 1, 0, 0},
  {&__pyx_n_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 1},
  {&__pyx_kp_b__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 0, 0, 0},
  {&__pyx_n_u_ab, __pyx_k_ab, sizeof(__pyx_k_ab), 0, 1, 0, 1},
  {&__pyx_kp_u_accessing_non_existent_buffer_se, __pyx_k_accessing_non_existent_buffer_se, sizeof(__pyx_k_accessing_non_existent_buffer_se), 0, 1, 0, 0},
  {&__pyx_n_s_ad, __pyx_k_ad, sizeof(__pyx_k_ad), 0, 0, 1, 1},
  {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1},
  {&__pyx_n_s_add_column, __pyx_k_add_column, sizeof(__pyx_k_add_column), 0, 0, 1, 1},
  {&__pyx_n_s_address, __pyx_k_address, sizeof(__pyx_k_address), 0, 0, 1, 1},
  {&__pyx_n_s_alias, __pyx_k_alias, sizeof(__pyx_k_alias), 0, 0, 1, 1},
  {&__pyx_n_s_alignment, __pyx_k_alignment, sizeof(__pyx_k_alignment), 0, 0, 1, 1},
  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
  {&__pyx_n_s_api, __pyx_k_api, sizeof(__pyx_k_api), 0, 0, 1, 1},
  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
  {&__pyx_n_s_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_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_u_as_py, __pyx_k_as_py, sizeof(__pyx_k_as_py), 0, 1, 0, 1},
  {&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 0, 1, 1},
  {&__pyx_n_s_asbytes, __pyx_k_asbytes, sizeof(__pyx_k_asbytes), 0, 0, 1, 1},
  {&__pyx_n_s_assert_frame_equal, __pyx_k_assert_frame_equal, sizeof(__pyx_k_assert_frame_equal), 0, 0, 1, 1},
  {&__pyx_n_s_assert_open, __pyx_k_assert_open, sizeof(__pyx_k_assert_open), 0, 0, 1, 1},
  {&__pyx_n_s_assert_readable, __pyx_k_assert_readable, sizeof(__pyx_k_assert_readable), 0, 0, 1, 1},
  {&__pyx_n_s_assert_seekable, __pyx_k_assert_seekable, sizeof(__pyx_k_assert_seekable), 0, 0, 1, 1},
  {&__pyx_n_s_assert_writable, __pyx_k_assert_writable, sizeof(__pyx_k_assert_writable), 0, 0, 1, 1},
  {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1},
  {&__pyx_n_b_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 0, 1},
  {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
  {&__pyx_n_b_bBhHiIqQ, __pyx_k_bBhHiIqQ, sizeof(__pyx_k_bBhHiIqQ), 0, 0, 0, 1},
  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
  {&__pyx_n_s_bases, __pyx_k_bases, sizeof(__pyx_k_bases), 0, 0, 1, 1},
  {&__pyx_n_s_batch, __pyx_k_batch, sizeof(__pyx_k_batch), 0, 0, 1, 1},
  {&__pyx_n_s_batches, __pyx_k_batches, sizeof(__pyx_k_batches), 0, 0, 1, 1},
  {&__pyx_n_s_benchmark_PandasObjectIsNull, __pyx_k_benchmark_PandasObjectIsNull, sizeof(__pyx_k_benchmark_PandasObjectIsNull), 0, 0, 1, 1},
  {&__pyx_n_s_bg_write, __pyx_k_bg_write, sizeof(__pyx_k_bg_write), 0, 0, 1, 1},
  {&__pyx_n_s_binary, __pyx_k_binary, sizeof(__pyx_k_binary), 0, 0, 1, 1},
  {&__pyx_n_u_binary, __pyx_k_binary, sizeof(__pyx_k_binary), 0, 1, 0, 1},
  {&__pyx_n_s_binary_type, __pyx_k_binary_type, sizeof(__pyx_k_binary_type), 0, 0, 1, 1},
  {&__pyx_n_s_bit_width, __pyx_k_bit_width, sizeof(__pyx_k_bit_width), 0, 0, 1, 1},
  {&__pyx_n_u_block_size, __pyx_k_block_size, sizeof(__pyx_k_block_size), 0, 1, 0, 1},
  {&__pyx_n_s_body, __pyx_k_body, sizeof(__pyx_k_body), 0, 0, 1, 1},
  {&__pyx_n_s_body_length, __pyx_k_body_length, sizeof(__pyx_k_body_length), 0, 0, 1, 1},
  {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1},
  {&__pyx_n_u_bool_2, __pyx_k_bool_2, sizeof(__pyx_k_bool_2), 0, 1, 0, 1},
  {&__pyx_n_u_boolean, __pyx_k_boolean, sizeof(__pyx_k_boolean), 0, 1, 0, 1},
  {&__pyx_n_s_boxed_field, __pyx_k_boxed_field, sizeof(__pyx_k_boxed_field), 0, 0, 1, 1},
  {&__pyx_n_u_brotli, __pyx_k_brotli, sizeof(__pyx_k_brotli), 0, 1, 0, 1},
  {&__pyx_n_s_buf, __pyx_k_buf, sizeof(__pyx_k_buf), 0, 0, 1, 1},
  {&__pyx_n_s_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 0, 1, 1},
  {&__pyx_n_s_buffer_size, __pyx_k_buffer_size, sizeof(__pyx_k_buffer_size), 0, 0, 1, 1},
  {&__pyx_n_s_buffers, __pyx_k_buffers, sizeof(__pyx_k_buffers), 0, 0, 1, 1},
  {&__pyx_n_s_builtin_pickle, __pyx_k_builtin_pickle, sizeof(__pyx_k_builtin_pickle), 0, 0, 1, 1},
  {&__pyx_n_s_byte_width, __pyx_k_byte_width, sizeof(__pyx_k_byte_width), 0, 0, 1, 1},
  {&__pyx_n_u_bz2, __pyx_k_bz2, sizeof(__pyx_k_bz2), 0, 1, 0, 1},
  {&__pyx_kp_u_bz2_2, __pyx_k_bz2_2, sizeof(__pyx_k_bz2_2), 0, 1, 0, 0},
  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
  {&__pyx_n_s_c_addr, __pyx_k_c_addr, sizeof(__pyx_k_c_addr), 0, 0, 1, 1},
  {&__pyx_n_s_c_array, __pyx_k_c_array, sizeof(__pyx_k_c_array), 0, 0, 1, 1},
  {&__pyx_n_s_c_arrays, __pyx_k_c_arrays, sizeof(__pyx_k_c_arrays), 0, 0, 1, 1},
  {&__pyx_n_s_c_batches, __pyx_k_c_batches, sizeof(__pyx_k_c_batches), 0, 0, 1, 1},
  {&__pyx_n_s_c_buf, __pyx_k_c_buf, sizeof(__pyx_k_c_buf), 0, 0, 1, 1},
  {&__pyx_n_s_c_buffers, __pyx_k_c_buffers, sizeof(__pyx_k_c_buffers), 0, 0, 1, 1},
  {&__pyx_n_s_c_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_categorical_type, __pyx_k_categorical_type, sizeof(__pyx_k_categorical_type), 0, 0, 1, 1},
  {&__pyx_n_s_categories, __pyx_k_categories, sizeof(__pyx_k_categories), 0, 0, 1, 1},
  {&__pyx_n_s_check_metadata, __pyx_k_check_metadata, sizeof(__pyx_k_check_metadata), 0, 0, 1, 1},
  {&__pyx_n_s_child, __pyx_k_child, sizeof(__pyx_k_child), 0, 0, 1, 1},
  {&__pyx_n_s_child_field, __pyx_k_child_field, sizeof(__pyx_k_child_field), 0, 0, 1, 1},
  {&__pyx_n_s_children, __pyx_k_children, sizeof(__pyx_k_children), 0, 0, 1, 1},
  {&__pyx_n_s_children_fields, __pyx_k_children_fields, sizeof(__pyx_k_children_fields), 0, 0, 1, 1},
  {&__pyx_n_s_chunk, __pyx_k_chunk, sizeof(__pyx_k_chunk), 0, 0, 1, 1},
  {&__pyx_n_s_chunked_array, __pyx_k_chunked_array, sizeof(__pyx_k_chunked_array), 0, 0, 1, 1},
  {&__pyx_n_s_chunks, __pyx_k_chunks, sizeof(__pyx_k_chunks), 0, 0, 1, 1},
  {&__pyx_n_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_closed, __pyx_k_closed, sizeof(__pyx_k_closed), 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_common, __pyx_k_common, sizeof(__pyx_k_common), 0, 0, 1, 1},
  {&__pyx_n_s_compat, __pyx_k_compat, sizeof(__pyx_k_compat), 0, 0, 1, 1},
  {&__pyx_n_s_compile, __pyx_k_compile, sizeof(__pyx_k_compile), 0, 0, 1, 1},
  {&__pyx_n_s_components, __pyx_k_components, sizeof(__pyx_k_components), 0, 0, 1, 1},
  {&__pyx_n_s_compress, __pyx_k_compress, sizeof(__pyx_k_compress), 0, 0, 1, 1},
  {&__pyx_n_s_compression, __pyx_k_compression, sizeof(__pyx_k_compression), 0, 0, 1, 1},
  {&__pyx_n_s_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_n_s_core, __pyx_k_core, sizeof(__pyx_k_core), 0, 0, 1, 1},
  {&__pyx_kp_u_could_not_infer_open_mode_for_fi, __pyx_k_could_not_infer_open_mode_for_fi, sizeof(__pyx_k_could_not_infer_open_mode_for_fi), 0, 1, 0, 0},
  {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1},
  {&__pyx_n_s_cpool, __pyx_k_cpool, sizeof(__pyx_k_cpool), 0, 0, 1, 1},
  {&__pyx_n_s_cpp_file, __pyx_k_cpp_file, sizeof(__pyx_k_cpp_file), 0, 0, 1, 1},
  {&__pyx_n_s_cpu_count, __pyx_k_cpu_count, sizeof(__pyx_k_cpu_count), 0, 0, 1, 1},
  {&__pyx_n_s_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_u_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 1, 0, 1},
  {&__pyx_n_s_data_frame, __pyx_k_data_frame, sizeof(__pyx_k_data_frame), 0, 0, 1, 1},
  {&__pyx_n_s_dataframe_to_arrays, __pyx_k_dataframe_to_arrays, sizeof(__pyx_k_dataframe_to_arrays), 0, 0, 1, 1},
  {&__pyx_n_s_dataframe_to_types, __pyx_k_dataframe_to_types, sizeof(__pyx_k_dataframe_to_types), 0, 0, 1, 1},
  {&__pyx_n_s_date, __pyx_k_date, sizeof(__pyx_k_date), 0, 0, 1, 1},
  {&__pyx_n_s_date32, __pyx_k_date32, sizeof(__pyx_k_date32), 0, 0, 1, 1},
  {&__pyx_n_u_date32, __pyx_k_date32, sizeof(__pyx_k_date32), 0, 1, 0, 1},
  {&__pyx_kp_u_date32_day, __pyx_k_date32_day, sizeof(__pyx_k_date32_day), 0, 1, 0, 0},
  {&__pyx_n_s_date64, __pyx_k_date64, sizeof(__pyx_k_date64), 0, 0, 1, 1},
  {&__pyx_n_u_date64, __pyx_k_date64, sizeof(__pyx_k_date64), 0, 1, 0, 1},
  {&__pyx_kp_u_date64_ms, __pyx_k_date64_ms, sizeof(__pyx_k_date64_ms), 0, 1, 0, 0},
  {&__pyx_n_s_date_as_object, __pyx_k_date_as_object, sizeof(__pyx_k_date_as_object), 0, 0, 1, 1},
  {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1},
  {&__pyx_kp_u_datetime64_ns, __pyx_k_datetime64_ns, sizeof(__pyx_k_datetime64_ns), 0, 1, 0, 0},
  {&__pyx_n_s_datetime_conversion_functions_l, __pyx_k_datetime_conversion_functions_l, sizeof(__pyx_k_datetime_conversion_functions_l), 0, 0, 1, 1},
  {&__pyx_n_s_decimal, __pyx_k_decimal, sizeof(__pyx_k_decimal), 0, 0, 1, 1},
  {&__pyx_n_s_decimal128, __pyx_k_decimal128, sizeof(__pyx_k_decimal128), 0, 0, 1, 1},
  {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
  {&__pyx_n_s_decompress, __pyx_k_decompress, sizeof(__pyx_k_decompress), 0, 0, 1, 1},
  {&__pyx_n_s_decompressed_size, __pyx_k_decompressed_size, sizeof(__pyx_k_decompressed_size), 0, 0, 1, 1},
  {&__pyx_n_s_deduplicate_objects, __pyx_k_deduplicate_objects, sizeof(__pyx_k_deduplicate_objects), 0, 0, 1, 1},
  {&__pyx_n_s_default_block_size, __pyx_k_default_block_size, sizeof(__pyx_k_default_block_size), 0, 0, 1, 1},
  {&__pyx_n_s_default_context_initialized, __pyx_k_default_context_initialized, sizeof(__pyx_k_default_context_initialized), 0, 0, 1, 1},
  {&__pyx_n_s_default_memory_pool, __pyx_k_default_memory_pool, sizeof(__pyx_k_default_memory_pool), 0, 0, 1, 1},
  {&__pyx_n_s_default_serialization_context, __pyx_k_default_serialization_context, sizeof(__pyx_k_default_serialization_context), 0, 0, 1, 1},
  {&__pyx_n_u_dense, __pyx_k_dense, sizeof(__pyx_k_dense), 0, 1, 0, 1},
  {&__pyx_n_s_deserialize, __pyx_k_deserialize, sizeof(__pyx_k_deserialize), 0, 0, 1, 1},
  {&__pyx_n_s_deserialize_components, __pyx_k_deserialize_components, sizeof(__pyx_k_deserialize_components), 0, 0, 1, 1},
  {&__pyx_n_s_deserialize_from, __pyx_k_deserialize_from, sizeof(__pyx_k_deserialize_from), 0, 0, 1, 1},
  {&__pyx_n_s_deserializer, __pyx_k_deserializer, sizeof(__pyx_k_deserializer), 0, 0, 1, 1},
  {&__pyx_n_s_dest, __pyx_k_dest, sizeof(__pyx_k_dest), 0, 0, 1, 1},
  {&__pyx_n_u_detect, __pyx_k_detect, sizeof(__pyx_k_detect), 0, 1, 0, 1},
  {&__pyx_n_s_detect_compression, __pyx_k_detect_compression, sizeof(__pyx_k_detect_compression), 0, 0, 1, 1},
  {&__pyx_n_s_df, __pyx_k_df, sizeof(__pyx_k_df), 0, 0, 1, 1},
  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
  {&__pyx_n_u_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 1, 0, 1},
  {&__pyx_n_s_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_u_dictionary, __pyx_k_dictionary, sizeof(__pyx_k_dictionary), 0, 1, 0, 1},
  {&__pyx_n_s_dictionary_2, __pyx_k_dictionary_2, sizeof(__pyx_k_dictionary_2), 0, 0, 1, 1},
  {&__pyx_n_s_dictionary_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_u_directory, __pyx_k_directory, sizeof(__pyx_k_directory), 0, 1, 0, 1},
  {&__pyx_n_s_distutils_version, __pyx_k_distutils_version, sizeof(__pyx_k_distutils_version), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_u_double, __pyx_k_double, sizeof(__pyx_k_double), 0, 1, 0, 1},
  {&__pyx_n_s_download, __pyx_k_download, sizeof(__pyx_k_download), 0, 0, 1, 1},
  {&__pyx_n_s_download_locals_bg_write, __pyx_k_download_locals_bg_write, sizeof(__pyx_k_download_locals_bg_write), 0, 0, 1, 1},
  {&__pyx_n_s_download_locals_cleanup, __pyx_k_download_locals_cleanup, sizeof(__pyx_k_download_locals_cleanup), 0, 0, 1, 1},
  {&__pyx_n_s_driver, __pyx_k_driver, sizeof(__pyx_k_driver), 0, 0, 1, 1},
  {&__pyx_n_s_dt, __pyx_k_dt, sizeof(__pyx_k_dt), 0, 0, 1, 1},
  {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
  {&__pyx_n_s_dumps, __pyx_k_dumps, sizeof(__pyx_k_dumps), 0, 0, 1, 1},
  {&__pyx_n_b_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 0, 1},
  {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1},
  {&__pyx_n_s_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 0, 1, 1},
  {&__pyx_n_s_encode_file_path, __pyx_k_encode_file_path, sizeof(__pyx_k_encode_file_path), 0, 0, 1, 1},
  {&__pyx_n_s_endswith, __pyx_k_endswith, sizeof(__pyx_k_endswith), 0, 0, 1, 1},
  {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1},
  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
  {&__pyx_n_s_equals, __pyx_k_equals, sizeof(__pyx_k_equals), 0, 0, 1, 1},
  {&__pyx_n_s_example_object, __pyx_k_example_object, sizeof(__pyx_k_example_object), 0, 0, 1, 1},
  {&__pyx_n_s_exc_info, __pyx_k_exc_info, sizeof(__pyx_k_exc_info), 0, 0, 1, 1},
  {&__pyx_n_s_exc_tb, __pyx_k_exc_tb, sizeof(__pyx_k_exc_tb), 0, 0, 1, 1},
  {&__pyx_n_s_exc_type, __pyx_k_exc_type, sizeof(__pyx_k_exc_type), 0, 0, 1, 1},
  {&__pyx_n_s_exc_val, __pyx_k_exc_val, sizeof(__pyx_k_exc_val), 0, 0, 1, 1},
  {&__pyx_n_s_exc_value, __pyx_k_exc_value, sizeof(__pyx_k_exc_value), 0, 0, 1, 1},
  {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1},
  {&__pyx_n_s_extra_conf, __pyx_k_extra_conf, sizeof(__pyx_k_extra_conf), 0, 0, 1, 1},
  {&__pyx_n_b_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 0, 1},
  {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1},
  {&__pyx_n_u_f2, __pyx_k_f2, sizeof(__pyx_k_f2), 0, 1, 0, 1},
  {&__pyx_n_u_f4, __pyx_k_f4, sizeof(__pyx_k_f4), 0, 1, 0, 1},
  {&__pyx_n_u_f8, __pyx_k_f8, sizeof(__pyx_k_f8), 0, 1, 0, 1},
  {&__pyx_n_s_fastpath, __pyx_k_fastpath, sizeof(__pyx_k_fastpath), 0, 0, 1, 1},
  {&__pyx_n_s_field, __pyx_k_field, sizeof(__pyx_k_field), 0, 0, 1, 1},
  {&__pyx_n_s_field_or_name, __pyx_k_field_or_name, sizeof(__pyx_k_field_or_name), 0, 0, 1, 1},
  {&__pyx_kp_u_field_or_tuple_expected_got_None, __pyx_k_field_or_tuple_expected_got_None, sizeof(__pyx_k_field_or_tuple_expected_got_None), 0, 1, 0, 0},
  {&__pyx_n_s_fields, __pyx_k_fields, sizeof(__pyx_k_fields), 0, 0, 1, 1},
  {&__pyx_n_u_fields_2, __pyx_k_fields_2, sizeof(__pyx_k_fields_2), 0, 1, 0, 1},
  {&__pyx_n_u_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 1, 0, 1},
  {&__pyx_n_s_file_descriptor, __pyx_k_file_descriptor, sizeof(__pyx_k_file_descriptor), 0, 0, 1, 1},
  {&__pyx_n_s_file_handle, __pyx_k_file_handle, sizeof(__pyx_k_file_handle), 0, 0, 1, 1},
  {&__pyx_n_s_file_type, __pyx_k_file_type, sizeof(__pyx_k_file_type), 0, 0, 1, 1},
  {&__pyx_n_s_fixed_offset_to_string, __pyx_k_fixed_offset_to_string, sizeof(__pyx_k_fixed_offset_to_string), 0, 0, 1, 1},
  {&__pyx_n_s_fixed_size_binary_type, __pyx_k_fixed_size_binary_type, sizeof(__pyx_k_fixed_size_binary_type), 0, 0, 1, 1},
  {&__pyx_n_u_float, __pyx_k_float, sizeof(__pyx_k_float), 0, 1, 0, 1},
  {&__pyx_n_s_float16, __pyx_k_float16, sizeof(__pyx_k_float16), 0, 0, 1, 1},
  {&__pyx_n_u_float16, __pyx_k_float16, sizeof(__pyx_k_float16), 0, 1, 0, 1},
  {&__pyx_n_s_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 1, 1},
  {&__pyx_n_u_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 1, 0, 1},
  {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
  {&__pyx_n_u_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 1, 0, 1},
  {&__pyx_n_s_footer_offset, __pyx_k_footer_offset, sizeof(__pyx_k_footer_offset), 0, 0, 1, 1},
  {&__pyx_n_s_foreign_buffer, __pyx_k_foreign_buffer, sizeof(__pyx_k_foreign_buffer), 0, 0, 1, 1},
  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
  {&__pyx_n_s_from_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_u_from_buffers_is_only_supported_f, __pyx_k_from_buffers_is_only_supported_f, sizeof(__pyx_k_from_buffers_is_only_supported_f), 0, 1, 0, 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_default_context, __pyx_k_get_default_context, sizeof(__pyx_k_get_default_context), 0, 0, 1, 1},
  {&__pyx_n_s_get_field_index, __pyx_k_get_field_index, sizeof(__pyx_k_get_field_index), 0, 0, 1, 1},
  {&__pyx_n_s_get_record_batch, __pyx_k_get_record_batch, sizeof(__pyx_k_get_record_batch), 0, 0, 1, 1},
  {&__pyx_n_s_get_record_batch_size, __pyx_k_get_record_batch_size, sizeof(__pyx_k_get_record_batch_size), 0, 0, 1, 1},
  {&__pyx_n_s_get_space_used, __pyx_k_get_space_used, sizeof(__pyx_k_get_space_used), 0, 0, 1, 1},
  {&__pyx_n_s_get_tensor_size, __pyx_k_get_tensor_size, sizeof(__pyx_k_get_tensor_size), 0, 0, 1, 1},
  {&__pyx_n_s_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_u_group, __pyx_k_group, sizeof(__pyx_k_group), 0, 1, 0, 1},
  {&__pyx_kp_u_gz, __pyx_k_gz, sizeof(__pyx_k_gz), 0, 1, 0, 0},
  {&__pyx_n_u_gzip, __pyx_k_gzip, sizeof(__pyx_k_gzip), 0, 1, 0, 1},
  {&__pyx_n_b_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 0, 1},
  {&__pyx_n_u_halffloat, __pyx_k_halffloat, sizeof(__pyx_k_halffloat), 0, 1, 0, 1},
  {&__pyx_n_s_handle, __pyx_k_handle, sizeof(__pyx_k_handle), 0, 0, 1, 1},
  {&__pyx_n_s_have_libhdfs, __pyx_k_have_libhdfs, sizeof(__pyx_k_have_libhdfs), 0, 0, 1, 1},
  {&__pyx_n_s_have_libhdfs3, __pyx_k_have_libhdfs3, sizeof(__pyx_k_have_libhdfs3), 0, 0, 1, 1},
  {&__pyx_n_s_have_pandas, __pyx_k_have_pandas, sizeof(__pyx_k_have_pandas), 0, 0, 1, 1},
  {&__pyx_kp_u_hdfs_d, __pyx_k_hdfs_d, sizeof(__pyx_k_hdfs_d), 0, 1, 0, 0},
  {&__pyx_n_s_hint, __pyx_k_hint, sizeof(__pyx_k_hint), 0, 0, 1, 1},
  {&__pyx_n_s_host, __pyx_k_host, sizeof(__pyx_k_host), 0, 0, 1, 1},
  {&__pyx_n_s_hours, __pyx_k_hours, sizeof(__pyx_k_hours), 0, 0, 1, 1},
  {&__pyx_n_b_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 0, 1},
  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  {&__pyx_n_u_i1, __pyx_k_i1, sizeof(__pyx_k_i1), 0, 1, 0, 1},
  {&__pyx_n_u_i2, __pyx_k_i2, sizeof(__pyx_k_i2), 0, 1, 0, 1},
  {&__pyx_n_u_i4, __pyx_k_i4, sizeof(__pyx_k_i4), 0, 1, 0, 1},
  {&__pyx_n_u_i8, __pyx_k_i8, sizeof(__pyx_k_i8), 0, 1, 0, 1},
  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
  {&__pyx_n_s_ignore_metadata, __pyx_k_ignore_metadata, sizeof(__pyx_k_ignore_metadata), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_in_stream, __pyx_k_in_stream, sizeof(__pyx_k_in_stream), 0, 0, 1, 1},
  {&__pyx_n_s_indent, __pyx_k_indent, sizeof(__pyx_k_indent), 0, 0, 1, 1},
  {&__pyx_kp_u_index_out_of_bounds, __pyx_k_index_out_of_bounds, sizeof(__pyx_k_index_out_of_bounds), 0, 1, 0, 0},
  {&__pyx_n_s_index_type, __pyx_k_index_type, sizeof(__pyx_k_index_type), 0, 0, 1, 1},
  {&__pyx_n_s_index_value, __pyx_k_index_value, sizeof(__pyx_k_index_value), 0, 0, 1, 1},
  {&__pyx_n_s_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 0, 1, 1},
  {&__pyx_n_u_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 1, 0, 1},
  {&__pyx_n_s_indices_2, __pyx_k_indices_2, sizeof(__pyx_k_indices_2), 0, 0, 1, 1},
  {&__pyx_n_s_infer_dtype, __pyx_k_infer_dtype, sizeof(__pyx_k_infer_dtype), 0, 0, 1, 1},
  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  {&__pyx_n_s_input_stream, __pyx_k_input_stream, sizeof(__pyx_k_input_stream), 0, 0, 1, 1},
  {&__pyx_n_s_insert, __pyx_k_insert, sizeof(__pyx_k_insert), 0, 0, 1, 1},
  {&__pyx_n_s_int16, __pyx_k_int16, sizeof(__pyx_k_int16), 0, 0, 1, 1},
  {&__pyx_n_u_int16, __pyx_k_int16, sizeof(__pyx_k_int16), 0, 1, 0, 1},
  {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1},
  {&__pyx_n_u_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 1, 0, 1},
  {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1},
  {&__pyx_n_u_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 1, 0, 1},
  {&__pyx_n_s_int8, __pyx_k_int8, sizeof(__pyx_k_int8), 0, 0, 1, 1},
  {&__pyx_n_u_int8, __pyx_k_int8, sizeof(__pyx_k_int8), 0, 1, 0, 1},
  {&__pyx_n_s_integer_object_nulls, __pyx_k_integer_object_nulls, sizeof(__pyx_k_integer_object_nulls), 0, 0, 1, 1},
  {&__pyx_n_s_integer_types, __pyx_k_integer_types, sizeof(__pyx_k_integer_types), 0, 0, 1, 1},
  {&__pyx_n_s_io, __pyx_k_io, sizeof(__pyx_k_io), 0, 0, 1, 1},
  {&__pyx_n_s_is_alive, __pyx_k_is_alive, sizeof(__pyx_k_is_alive), 0, 0, 1, 1},
  {&__pyx_n_s_is_array_like, __pyx_k_is_array_like, sizeof(__pyx_k_is_array_like), 0, 0, 1, 1},
  {&__pyx_n_s_is_boolean_value, __pyx_k_is_boolean_value, sizeof(__pyx_k_is_boolean_value), 0, 0, 1, 1},
  {&__pyx_n_s_is_categorical, __pyx_k_is_categorical, sizeof(__pyx_k_is_categorical), 0, 0, 1, 1},
  {&__pyx_n_s_is_data_frame, __pyx_k_is_data_frame, sizeof(__pyx_k_is_data_frame), 0, 0, 1, 1},
  {&__pyx_n_s_is_datetimetz, __pyx_k_is_datetimetz, sizeof(__pyx_k_is_datetimetz), 0, 0, 1, 1},
  {&__pyx_n_s_is_float_value, __pyx_k_is_float_value, sizeof(__pyx_k_is_float_value), 0, 0, 1, 1},
  {&__pyx_n_s_is_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_is_series, __pyx_k_is_series, sizeof(__pyx_k_is_series), 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_u_key_must_either_be_a_slice_or_in, __pyx_k_key_must_either_be_a_slice_or_in, sizeof(__pyx_k_key_must_either_be_a_slice_or_in), 0, 1, 0, 0},
  {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1},
  {&__pyx_n_u_kind, __pyx_k_kind, sizeof(__pyx_k_kind), 0, 1, 0, 1},
  {&__pyx_n_u_last_access_time, __pyx_k_last_access_time, sizeof(__pyx_k_last_access_time), 0, 1, 0, 1},
  {&__pyx_n_u_last_accessed, __pyx_k_last_accessed, sizeof(__pyx_k_last_accessed), 0, 1, 0, 1},
  {&__pyx_n_u_last_modified, __pyx_k_last_modified, sizeof(__pyx_k_last_modified), 0, 1, 0, 1},
  {&__pyx_n_u_last_modified_time, __pyx_k_last_modified_time, sizeof(__pyx_k_last_modified_time), 0, 1, 0, 1},
  {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1},
  {&__pyx_n_s_lib, __pyx_k_lib, sizeof(__pyx_k_lib), 0, 0, 1, 1},
  {&__pyx_n_u_libhdfs, __pyx_k_libhdfs, sizeof(__pyx_k_libhdfs), 0, 1, 0, 1},
  {&__pyx_n_u_libhdfs3, __pyx_k_libhdfs3, sizeof(__pyx_k_libhdfs3), 0, 1, 0, 1},
  {&__pyx_n_s_list, __pyx_k_list, sizeof(__pyx_k_list), 0, 0, 1, 1},
  {&__pyx_n_s_loads, __pyx_k_loads, sizeof(__pyx_k_loads), 0, 0, 1, 1},
  {&__pyx_n_s_log_memory_allocations, __pyx_k_log_memory_allocations, sizeof(__pyx_k_log_memory_allocations), 0, 0, 1, 1},
  {&__pyx_n_s_logging_memory_pool, __pyx_k_logging_memory_pool, sizeof(__pyx_k_logging_memory_pool), 0, 0, 1, 1},
  {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1},
  {&__pyx_n_u_lz4, __pyx_k_lz4, sizeof(__pyx_k_lz4), 0, 1, 0, 1},
  {&__pyx_kp_u_lz4_2, __pyx_k_lz4_2, sizeof(__pyx_k_lz4_2), 0, 1, 0, 0},
  {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_make_datetimetz, __pyx_k_make_datetimetz, sizeof(__pyx_k_make_datetimetz), 0, 0, 1, 1},
  {&__pyx_n_s_make_series, __pyx_k_make_series, sizeof(__pyx_k_make_series), 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_u_mask_not_implemented_with_Arrow, __pyx_k_mask_not_implemented_with_Arrow, sizeof(__pyx_k_mask_not_implemented_with_Arrow), 0, 1, 0, 0},
  {&__pyx_n_s_match, __pyx_k_match, sizeof(__pyx_k_match), 0, 0, 1, 1},
  {&__pyx_n_s_max_output_size, __pyx_k_max_output_size, sizeof(__pyx_k_max_output_size), 0, 0, 1, 1},
  {&__pyx_n_s_memory_map, __pyx_k_memory_map, sizeof(__pyx_k_memory_map), 0, 0, 1, 1},
  {&__pyx_n_s_memory_pool, __pyx_k_memory_pool, sizeof(__pyx_k_memory_pool), 0, 0, 1, 1},
  {&__pyx_n_s_memoryview, __pyx_k_memoryview, sizeof(__pyx_k_memoryview), 0, 0, 1, 1},
  {&__pyx_n_s_message, __pyx_k_message, sizeof(__pyx_k_message), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_s_metadata, __pyx_k_metadata, sizeof(__pyx_k_metadata), 0, 0, 1, 1},
  {&__pyx_kp_u_metadata_2, __pyx_k_metadata_2, sizeof(__pyx_k_metadata_2), 0, 1, 0, 0},
  {&__pyx_n_s_metadata_length, __pyx_k_metadata_length, sizeof(__pyx_k_metadata_length), 0, 0, 1, 1},
  {&__pyx_n_s_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_mmap, __pyx_k_mmap, sizeof(__pyx_k_mmap), 0, 0, 1, 1},
  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {&__pyx_n_s_mro, __pyx_k_mro, sizeof(__pyx_k_mro), 0, 0, 1, 1},
  {&__pyx_n_u_ms, __pyx_k_ms, sizeof(__pyx_k_ms), 0, 1, 0, 1},
  {&__pyx_n_s_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_u_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 1, 0, 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_ndarray_to_arrow_type, __pyx_k_ndarray_to_arrow_type, sizeof(__pyx_k_ndarray_to_arrow_type), 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_u_not_registered_in_deserializati, __pyx_k_not_registered_in_deserializati, sizeof(__pyx_k_not_registered_in_deserializati), 0, 1, 0, 0},
  {&__pyx_kp_u_not_supported_for_buffer_protoc, __pyx_k_not_supported_for_buffer_protoc, sizeof(__pyx_k_not_supported_for_buffer_protoc), 0, 1, 0, 0},
  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
  {&__pyx_n_u_ns, __pyx_k_ns, sizeof(__pyx_k_ns), 0, 1, 0, 1},
  {&__pyx_n_s_nthreads, __pyx_k_nthreads, sizeof(__pyx_k_nthreads), 0, 0, 1, 1},
  {&__pyx_n_s_null, __pyx_k_null, sizeof(__pyx_k_null), 0, 0, 1, 1},
  {&__pyx_n_u_null, __pyx_k_null, sizeof(__pyx_k_null), 0, 1, 0, 1},
  {&__pyx_n_s_null_bitmap, __pyx_k_null_bitmap, sizeof(__pyx_k_null_bitmap), 0, 0, 1, 1},
  {&__pyx_n_s_null_count, __pyx_k_null_count, sizeof(__pyx_k_null_count), 0, 0, 1, 1},
  {&__pyx_n_s_nullable, __pyx_k_nullable, sizeof(__pyx_k_nullable), 0, 0, 1, 1},
  {&__pyx_n_s_num_arrays, __pyx_k_num_arrays, sizeof(__pyx_k_num_arrays), 0, 0, 1, 1},
  {&__pyx_n_s_num_buffers, __pyx_k_num_buffers, sizeof(__pyx_k_num_buffers), 0, 0, 1, 1},
  {&__pyx_n_u_num_buffers, __pyx_k_num_buffers, sizeof(__pyx_k_num_buffers), 0, 1, 0, 1},
  {&__pyx_n_s_num_chunks, __pyx_k_num_chunks, sizeof(__pyx_k_num_chunks), 0, 0, 1, 1},
  {&__pyx_n_s_num_columns, __pyx_k_num_columns, sizeof(__pyx_k_num_columns), 0, 0, 1, 1},
  {&__pyx_n_s_num_ndarrays, __pyx_k_num_ndarrays, sizeof(__pyx_k_num_ndarrays), 0, 0, 1, 1},
  {&__pyx_n_u_num_ndarrays, __pyx_k_num_ndarrays, sizeof(__pyx_k_num_ndarrays), 0, 1, 0, 1},
  {&__pyx_n_s_num_record_batches, __pyx_k_num_record_batches, sizeof(__pyx_k_num_record_batches), 0, 0, 1, 1},
  {&__pyx_n_s_num_rows, __pyx_k_num_rows, sizeof(__pyx_k_num_rows), 0, 0, 1, 1},
  {&__pyx_n_s_num_tensors, __pyx_k_num_tensors, sizeof(__pyx_k_num_tensors), 0, 0, 1, 1},
  {&__pyx_n_u_num_tensors, __pyx_k_num_tensors, sizeof(__pyx_k_num_tensors), 0, 1, 0, 1},
  {&__pyx_n_s_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_u_only_slices_with_step_1_supporte, __pyx_k_only_slices_with_step_1_supporte, sizeof(__pyx_k_only_slices_with_step_1_supporte), 0, 1, 0, 0},
  {&__pyx_kp_u_only_valid_on_readonly_files, __pyx_k_only_valid_on_readonly_files, sizeof(__pyx_k_only_valid_on_readonly_files), 0, 1, 0, 0},
  {&__pyx_kp_u_only_valid_on_seekable_files, __pyx_k_only_valid_on_seekable_files, sizeof(__pyx_k_only_valid_on_seekable_files), 0, 1, 0, 0},
  {&__pyx_kp_u_only_valid_on_writable_files, __pyx_k_only_valid_on_writable_files, sizeof(__pyx_k_only_valid_on_writable_files), 0, 1, 0, 0},
  {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1},
  {&__pyx_n_s_open_2, __pyx_k_open_2, sizeof(__pyx_k_open_2), 0, 0, 1, 1},
  {&__pyx_n_s_open_stream, __pyx_k_open_stream, sizeof(__pyx_k_open_stream), 0, 0, 1, 1},
  {&__pyx_n_s_options, __pyx_k_options, sizeof(__pyx_k_options), 0, 0, 1, 1},
  {&__pyx_n_s_ordered, __pyx_k_ordered, sizeof(__pyx_k_ordered), 0, 0, 1, 1},
  {&__pyx_n_u_ordered, __pyx_k_ordered, sizeof(__pyx_k_ordered), 0, 1, 0, 1},
  {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
  {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1},
  {&__pyx_n_s_out, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 1, 1},
  {&__pyx_n_s_out_buf, __pyx_k_out_buf, sizeof(__pyx_k_out_buf), 0, 0, 1, 1},
  {&__pyx_n_s_output_buffer, __pyx_k_output_buffer, sizeof(__pyx_k_output_buffer), 0, 0, 1, 1},
  {&__pyx_n_s_output_length, __pyx_k_output_length, sizeof(__pyx_k_output_length), 0, 0, 1, 1},
  {&__pyx_n_s_output_size, __pyx_k_output_size, sizeof(__pyx_k_output_size), 0, 0, 1, 1},
  {&__pyx_n_s_output_stream, __pyx_k_output_stream, sizeof(__pyx_k_output_stream), 0, 0, 1, 1},
  {&__pyx_n_s_owner, __pyx_k_owner, sizeof(__pyx_k_owner), 0, 0, 1, 1},
  {&__pyx_n_u_owner, __pyx_k_owner, sizeof(__pyx_k_owner), 0, 1, 0, 1},
  {&__pyx_n_u_pa_getnewargs, __pyx_k_pa_getnewargs, sizeof(__pyx_k_pa_getnewargs), 0, 1, 0, 1},
  {&__pyx_kp_u_pa_input_stream_called_with_inst, __pyx_k_pa_input_stream_called_with_inst, sizeof(__pyx_k_pa_input_stream_called_with_inst), 0, 1, 0, 0},
  {&__pyx_kp_u_pa_output_stream_called_with_ins, __pyx_k_pa_output_stream_called_with_ins, sizeof(__pyx_k_pa_output_stream_called_with_ins), 0, 1, 0, 0},
  {&__pyx_n_b_pandas, __pyx_k_pandas, sizeof(__pyx_k_pandas), 0, 0, 0, 1},
  {&__pyx_n_s_pandas, __pyx_k_pandas, sizeof(__pyx_k_pandas), 0, 0, 1, 1},
  {&__pyx_n_s_pandas_api, __pyx_k_pandas_api, sizeof(__pyx_k_pandas_api), 0, 0, 1, 1},
  {&__pyx_n_s_pandas_api_types, __pyx_k_pandas_api_types, sizeof(__pyx_k_pandas_api_types), 0, 0, 1, 1},
  {&__pyx_n_s_pandas_types_dtypes, __pyx_k_pandas_types_dtypes, sizeof(__pyx_k_pandas_types_dtypes), 0, 0, 1, 1},
  {&__pyx_n_s_parent, __pyx_k_parent, sizeof(__pyx_k_parent), 0, 0, 1, 1},
  {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
  {&__pyx_n_u_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 1, 0, 1},
  {&__pyx_n_u_permissions, __pyx_k_permissions, sizeof(__pyx_k_permissions), 0, 1, 0, 1},
  {&__pyx_n_s_pformat, __pyx_k_pformat, sizeof(__pyx_k_pformat), 0, 0, 1, 1},
  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
  {&__pyx_n_u_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 1, 0, 1},
  {&__pyx_kp_u_please_pass_it_explicitly, __pyx_k_please_pass_it_explicitly, sizeof(__pyx_k_please_pass_it_explicitly), 0, 1, 0, 0},
  {&__pyx_n_s_pool, __pyx_k_pool, sizeof(__pyx_k_pool), 0, 0, 1, 1},
  {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1},
  {&__pyx_n_s_port, __pyx_k_port, sizeof(__pyx_k_port), 0, 0, 1, 1},
  {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1},
  {&__pyx_n_s_position, __pyx_k_position, sizeof(__pyx_k_position), 0, 0, 1, 1},
  {&__pyx_n_s_pprint, __pyx_k_pprint, sizeof(__pyx_k_pprint), 0, 0, 1, 1},
  {&__pyx_n_s_precision, __pyx_k_precision, sizeof(__pyx_k_precision), 0, 0, 1, 1},
  {&__pyx_kp_u_precision_should_be_between_1_an, __pyx_k_precision_should_be_between_1_an, sizeof(__pyx_k_precision_should_be_between_1_an), 0, 1, 0, 0},
  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {&__pyx_n_s_preserve_index, __pyx_k_preserve_index, sizeof(__pyx_k_preserve_index), 0, 0, 1, 1},
  {&__pyx_kp_u_prior_column_had_a_different_num, __pyx_k_prior_column_had_a_different_num, sizeof(__pyx_k_prior_column_had_a_different_num), 0, 1, 0, 0},
  {&__pyx_n_s_proxy_memory_pool, __pyx_k_proxy_memory_pool, sizeof(__pyx_k_proxy_memory_pool), 0, 0, 1, 1},
  {&__pyx_n_s_put_nowait, __pyx_k_put_nowait, sizeof(__pyx_k_put_nowait), 0, 0, 1, 1},
  {&__pyx_n_s_py_buffer, __pyx_k_py_buffer, sizeof(__pyx_k_py_buffer), 0, 0, 1, 1},
  {&__pyx_n_s_py_field, __pyx_k_py_field, sizeof(__pyx_k_py_field), 0, 0, 1, 1},
  {&__pyx_kp_u_pyarrow, __pyx_k_pyarrow, sizeof(__pyx_k_pyarrow), 0, 1, 0, 0},
  {&__pyx_kp_u_pyarrow_Field_0, __pyx_k_pyarrow_Field_0, sizeof(__pyx_k_pyarrow_Field_0), 0, 1, 0, 0},
  {&__pyx_kp_u_pyarrow_Message_type_0_metadata, __pyx_k_pyarrow_Message_type_0_metadata, sizeof(__pyx_k_pyarrow_Message_type_0_metadata), 0, 1, 0, 0},
  {&__pyx_kp_u_pyarrow_Tensor_type_0_type_shap, __pyx_k_pyarrow_Tensor_type_0_type_shap, sizeof(__pyx_k_pyarrow_Tensor_type_0_type_shap), 0, 1, 0, 0},
  {&__pyx_kp_s_pyarrow_array_pxi, __pyx_k_pyarrow_array_pxi, sizeof(__pyx_k_pyarrow_array_pxi), 0, 0, 1, 0},
  {&__pyx_kp_s_pyarrow_benchmark_pxi, __pyx_k_pyarrow_benchmark_pxi, sizeof(__pyx_k_pyarrow_benchmark_pxi), 0, 0, 1, 0},
  {&__pyx_n_s_pyarrow_compat, __pyx_k_pyarrow_compat, sizeof(__pyx_k_pyarrow_compat), 0, 0, 1, 1},
  {&__pyx_kp_u_pyarrow_does_not_know_how_to_ser, __pyx_k_pyarrow_does_not_know_how_to_ser, sizeof(__pyx_k_pyarrow_does_not_know_how_to_ser), 0, 1, 0, 0},
  {&__pyx_kp_s_pyarrow_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_n_s_pyarrow_serialization, __pyx_k_pyarrow_serialization, sizeof(__pyx_k_pyarrow_serialization), 0, 0, 1, 1},
  {&__pyx_kp_s_pyarrow_serialization_pxi, __pyx_k_pyarrow_serialization_pxi, sizeof(__pyx_k_pyarrow_serialization_pxi), 0, 0, 1, 0},
  {&__pyx_kp_s_pyarrow_table_pxi, __pyx_k_pyarrow_table_pxi, sizeof(__pyx_k_pyarrow_table_pxi), 0, 0, 1, 0},
  {&__pyx_kp_s_pyarrow_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_u_pytype, __pyx_k_pytype, sizeof(__pyx_k_pytype), 0, 1, 0, 1},
  {&__pyx_n_s_pytz, __pyx_k_pytz, sizeof(__pyx_k_pytz), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle_Scalar, __pyx_k_pyx_unpickle_Scalar, sizeof(__pyx_k_pyx_unpickle_Scalar), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle_SerializationCont, __pyx_k_pyx_unpickle_SerializationCont, sizeof(__pyx_k_pyx_unpickle_SerializationCont), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle__PandasAPIShim, __pyx_k_pyx_unpickle__PandasAPIShim, sizeof(__pyx_k_pyx_unpickle__PandasAPIShim), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle__PandasConvertibl, __pyx_k_pyx_unpickle__PandasConvertibl, sizeof(__pyx_k_pyx_unpickle__PandasConvertibl), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
  {&__pyx_n_b_q, __pyx_k_q, sizeof(__pyx_k_q), 0, 0, 0, 1},
  {&__pyx_n_s_qsize, __pyx_k_qsize, sizeof(__pyx_k_qsize), 0, 0, 1, 1},
  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {&__pyx_n_s_queue, __pyx_k_queue, sizeof(__pyx_k_queue), 0, 0, 1, 1},
  {&__pyx_n_u_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 1, 0, 1},
  {&__pyx_kp_u_r_2, __pyx_k_r_2, sizeof(__pyx_k_r_2), 0, 1, 0, 0},
  {&__pyx_kp_u_r_b, __pyx_k_r_b, sizeof(__pyx_k_r_b), 0, 1, 0, 0},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_kp_u_rb, __pyx_k_rb, sizeof(__pyx_k_rb), 0, 1, 0, 0},
  {&__pyx_n_u_rb_2, __pyx_k_rb_2, sizeof(__pyx_k_rb_2), 0, 1, 0, 1},
  {&__pyx_n_s_rd_file, __pyx_k_rd_file, sizeof(__pyx_k_rd_file), 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_u_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 1, 0, 1},
  {&__pyx_n_s_read_message, __pyx_k_read_message, sizeof(__pyx_k_read_message), 0, 0, 1, 1},
  {&__pyx_n_s_read_next_batch, __pyx_k_read_next_batch, sizeof(__pyx_k_read_next_batch), 0, 0, 1, 1},
  {&__pyx_n_s_read_next_message, __pyx_k_read_next_message, sizeof(__pyx_k_read_next_message), 0, 0, 1, 1},
  {&__pyx_n_s_read_record_batch, __pyx_k_read_record_batch, sizeof(__pyx_k_read_record_batch), 0, 0, 1, 1},
  {&__pyx_n_s_read_schema, __pyx_k_read_schema, sizeof(__pyx_k_read_schema), 0, 0, 1, 1},
  {&__pyx_n_s_read_serialized, __pyx_k_read_serialized, sizeof(__pyx_k_read_serialized), 0, 0, 1, 1},
  {&__pyx_n_s_read_tensor, __pyx_k_read_tensor, sizeof(__pyx_k_read_tensor), 0, 0, 1, 1},
  {&__pyx_n_s_readable, __pyx_k_readable, sizeof(__pyx_k_readable), 0, 0, 1, 1},
  {&__pyx_kp_u_readable_file_expected, __pyx_k_readable_file_expected, sizeof(__pyx_k_readable_file_expected), 0, 1, 0, 0},
  {&__pyx_n_s_reader, __pyx_k_reader, sizeof(__pyx_k_reader), 0, 0, 1, 1},
  {&__pyx_n_s_readline, __pyx_k_readline, sizeof(__pyx_k_readline), 0, 0, 1, 1},
  {&__pyx_n_s_readlines, __pyx_k_readlines, sizeof(__pyx_k_readlines), 0, 0, 1, 1},
  {&__pyx_n_s_reconstruct_record_batch, __pyx_k_reconstruct_record_batch, sizeof(__pyx_k_reconstruct_record_batch), 0, 0, 1, 1},
  {&__pyx_n_s_reconstruct_table, __pyx_k_reconstruct_table, sizeof(__pyx_k_reconstruct_table), 0, 0, 1, 1},
  {&__pyx_n_s_recursive, __pyx_k_recursive, sizeof(__pyx_k_recursive), 0, 0, 1, 1},
  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
  {&__pyx_n_s_ref, __pyx_k_ref, sizeof(__pyx_k_ref), 0, 0, 1, 1},
  {&__pyx_n_s_register, __pyx_k_register, sizeof(__pyx_k_register), 0, 0, 1, 1},
  {&__pyx_n_s_register_default_serialization_h, __pyx_k_register_default_serialization_h, sizeof(__pyx_k_register_default_serialization_h), 0, 0, 1, 1},
  {&__pyx_n_s_remove_column, __pyx_k_remove_column, sizeof(__pyx_k_remove_column), 0, 0, 1, 1},
  {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1},
  {&__pyx_n_s_replication, __pyx_k_replication, sizeof(__pyx_k_replication), 0, 0, 1, 1},
  {&__pyx_n_u_replication, __pyx_k_replication, sizeof(__pyx_k_replication), 0, 1, 0, 1},
  {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1},
  {&__pyx_n_s_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_u_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 1, 0, 1},
  {&__pyx_n_s_safe, __pyx_k_safe, sizeof(__pyx_k_safe), 0, 0, 1, 1},
  {&__pyx_n_s_scale, __pyx_k_scale, sizeof(__pyx_k_scale), 0, 0, 1, 1},
  {&__pyx_n_s_schema, __pyx_k_schema, sizeof(__pyx_k_schema), 0, 0, 1, 1},
  {&__pyx_n_s_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_logging_pool_self_pool_cann, __pyx_k_self_logging_pool_self_pool_cann, sizeof(__pyx_k_self_logging_pool_self_pool_cann), 0, 0, 1, 0},
  {&__pyx_kp_s_self_pool_cannot_be_converted_to, __pyx_k_self_pool_cannot_be_converted_to, sizeof(__pyx_k_self_pool_cannot_be_converted_to), 0, 0, 1, 0},
  {&__pyx_kp_s_self_pool_self_proxy_pool_cannot, __pyx_k_self_pool_self_proxy_pool_cannot, sizeof(__pyx_k_self_pool_self_proxy_pool_cannot), 0, 0, 1, 0},
  {&__pyx_kp_s_self_reader_cannot_be_converted, __pyx_k_self_reader_cannot_be_converted, sizeof(__pyx_k_self_reader_cannot_be_converted), 0, 0, 1, 0},
  {&__pyx_kp_s_self_sp_array_cannot_be_converte, __pyx_k_self_sp_array_cannot_be_converte, sizeof(__pyx_k_self_sp_array_cannot_be_converte), 0, 0, 1, 0},
  {&__pyx_kp_s_self_sp_scalar_cannot_be_convert, __pyx_k_self_sp_scalar_cannot_be_convert, sizeof(__pyx_k_self_sp_scalar_cannot_be_convert), 0, 0, 1, 0},
  {&__pyx_kp_s_self_sp_tensor_self_tp_cannot_be, __pyx_k_self_sp_tensor_self_tp_cannot_be, sizeof(__pyx_k_self_sp_tensor_self_tp_cannot_be), 0, 0, 1, 0},
  {&__pyx_kp_s_self_writer_cannot_be_converted, __pyx_k_self_writer_cannot_be_converted, sizeof(__pyx_k_self_writer_cannot_be_converted), 0, 0, 1, 0},
  {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
  {&__pyx_n_s_serialize, __pyx_k_serialize, sizeof(__pyx_k_serialize), 0, 0, 1, 1},
  {&__pyx_n_s_serialize_to, __pyx_k_serialize_to, sizeof(__pyx_k_serialize_to), 0, 0, 1, 1},
  {&__pyx_n_s_serialized, __pyx_k_serialized, sizeof(__pyx_k_serialized), 0, 0, 1, 1},
  {&__pyx_n_s_serializer, __pyx_k_serializer, sizeof(__pyx_k_serializer), 0, 0, 1, 1},
  {&__pyx_n_s_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_u_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 1, 0, 1},
  {&__pyx_n_s_skipna, __pyx_k_skipna, sizeof(__pyx_k_skipna), 0, 0, 1, 1},
  {&__pyx_n_s_sleep, __pyx_k_sleep, sizeof(__pyx_k_sleep), 0, 0, 1, 1},
  {&__pyx_n_s_slice, __pyx_k_slice, sizeof(__pyx_k_slice), 0, 0, 1, 1},
  {&__pyx_n_u_snappy, __pyx_k_snappy, sizeof(__pyx_k_snappy), 0, 1, 0, 1},
  {&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 0, 1, 1},
  {&__pyx_n_s_source_path, __pyx_k_source_path, sizeof(__pyx_k_source_path), 0, 0, 1, 1},
  {&__pyx_n_s_sp_chunked_array, __pyx_k_sp_chunked_array, sizeof(__pyx_k_sp_chunked_array), 0, 0, 1, 1},
  {&__pyx_n_s_sp_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_u_sparse, __pyx_k_sparse, sizeof(__pyx_k_sparse), 0, 1, 0, 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_u_str_2, __pyx_k_str_2, sizeof(__pyx_k_str_2), 0, 1, 0, 1},
  {&__pyx_n_s_stream, __pyx_k_stream, sizeof(__pyx_k_stream), 0, 0, 1, 1},
  {&__pyx_n_s_stream_or_path, __pyx_k_stream_or_path, sizeof(__pyx_k_stream_or_path), 0, 0, 1, 1},
  {&__pyx_n_s_string, __pyx_k_string, sizeof(__pyx_k_string), 0, 0, 1, 1},
  {&__pyx_n_u_string, __pyx_k_string, sizeof(__pyx_k_string), 0, 1, 0, 1},
  {&__pyx_n_s_string_to_tzinfo, __pyx_k_string_to_tzinfo, sizeof(__pyx_k_string_to_tzinfo), 0, 0, 1, 1},
  {&__pyx_n_s_string_types, __pyx_k_string_types, sizeof(__pyx_k_string_types), 0, 0, 1, 1},
  {&__pyx_n_s_stringify_path, __pyx_k_stringify_path, sizeof(__pyx_k_stringify_path), 0, 0, 1, 1},
  {&__pyx_n_s_strings_to_categorical, __pyx_k_strings_to_categorical, sizeof(__pyx_k_strings_to_categorical), 0, 0, 1, 1},
  {&__pyx_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_testing, __pyx_k_testing, sizeof(__pyx_k_testing), 0, 0, 1, 1},
  {&__pyx_n_s_threading, __pyx_k_threading, sizeof(__pyx_k_threading), 0, 0, 1, 1},
  {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
  {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
  {&__pyx_n_s_time32, __pyx_k_time32, sizeof(__pyx_k_time32), 0, 0, 1, 1},
  {&__pyx_kp_u_time32_ms, __pyx_k_time32_ms, sizeof(__pyx_k_time32_ms), 0, 1, 0, 0},
  {&__pyx_kp_u_time32_s, __pyx_k_time32_s, sizeof(__pyx_k_time32_s), 0, 1, 0, 0},
  {&__pyx_n_s_time64, __pyx_k_time64, sizeof(__pyx_k_time64), 0, 0, 1, 1},
  {&__pyx_kp_u_time64_ns, __pyx_k_time64_ns, sizeof(__pyx_k_time64_ns), 0, 1, 0, 0},
  {&__pyx_kp_u_time64_us, __pyx_k_time64_us, sizeof(__pyx_k_time64_us), 0, 1, 0, 0},
  {&__pyx_n_s_timedelta, __pyx_k_timedelta, sizeof(__pyx_k_timedelta), 0, 0, 1, 1},
  {&__pyx_n_s_timeout, __pyx_k_timeout, sizeof(__pyx_k_timeout), 0, 0, 1, 1},
  {&__pyx_n_s_timestamp, __pyx_k_timestamp, sizeof(__pyx_k_timestamp), 0, 0, 1, 1},
  {&__pyx_kp_u_timestamp_ms, __pyx_k_timestamp_ms, sizeof(__pyx_k_timestamp_ms), 0, 1, 0, 0},
  {&__pyx_kp_u_timestamp_ns, __pyx_k_timestamp_ns, sizeof(__pyx_k_timestamp_ns), 0, 1, 0, 0},
  {&__pyx_kp_u_timestamp_s, __pyx_k_timestamp_s, sizeof(__pyx_k_timestamp_s), 0, 1, 0, 0},
  {&__pyx_kp_u_timestamp_us, __pyx_k_timestamp_us, sizeof(__pyx_k_timestamp_us), 0, 1, 0, 0},
  {&__pyx_n_s_timezone, __pyx_k_timezone, sizeof(__pyx_k_timezone), 0, 0, 1, 1},
  {&__pyx_n_s_to_pandas, __pyx_k_to_pandas, sizeof(__pyx_k_to_pandas), 0, 0, 1, 1},
  {&__pyx_n_s_to_pandas_2, __pyx_k_to_pandas_2, sizeof(__pyx_k_to_pandas_2), 0, 0, 1, 1},
  {&__pyx_n_s_to_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_total_seconds, __pyx_k_total_seconds, sizeof(__pyx_k_total_seconds), 0, 0, 1, 1},
  {&__pyx_n_s_truncate, __pyx_k_truncate, sizeof(__pyx_k_truncate), 0, 0, 1, 1},
  {&__pyx_kp_u_trying_to_write_an_immutable_buf, __pyx_k_trying_to_write_an_immutable_buf, sizeof(__pyx_k_trying_to_write_an_immutable_buf), 0, 1, 0, 0},
  {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1},
  {&__pyx_kp_u_type_2, __pyx_k_type_2, sizeof(__pyx_k_type_2), 0, 1, 0, 0},
  {&__pyx_n_s_type_3, __pyx_k_type_3, sizeof(__pyx_k_type_3), 0, 0, 1, 1},
  {&__pyx_n_s_type_4, __pyx_k_type_4, sizeof(__pyx_k_type_4), 0, 0, 1, 1},
  {&__pyx_n_s_type_codes, __pyx_k_type_codes, sizeof(__pyx_k_type_codes), 0, 0, 1, 1},
  {&__pyx_n_s_type_for_alias, __pyx_k_type_for_alias, sizeof(__pyx_k_type_for_alias), 0, 0, 1, 1},
  {&__pyx_n_s_type_id, __pyx_k_type_id, sizeof(__pyx_k_type_id), 0, 0, 1, 1},
  {&__pyx_n_s_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_tzinfo_to_string_locals_fixed_of, __pyx_k_tzinfo_to_string_locals_fixed_of, sizeof(__pyx_k_tzinfo_to_string_locals_fixed_of), 0, 0, 1, 1},
  {&__pyx_n_u_u1, __pyx_k_u1, sizeof(__pyx_k_u1), 0, 1, 0, 1},
  {&__pyx_n_u_u2, __pyx_k_u2, sizeof(__pyx_k_u2), 0, 1, 0, 1},
  {&__pyx_n_u_u4, __pyx_k_u4, sizeof(__pyx_k_u4), 0, 1, 0, 1},
  {&__pyx_n_u_u8, __pyx_k_u8, sizeof(__pyx_k_u8), 0, 1, 0, 1},
  {&__pyx_n_s_uint16, __pyx_k_uint16, sizeof(__pyx_k_uint16), 0, 0, 1, 1},
  {&__pyx_n_u_uint16, __pyx_k_uint16, sizeof(__pyx_k_uint16), 0, 1, 0, 1},
  {&__pyx_n_s_uint32, __pyx_k_uint32, sizeof(__pyx_k_uint32), 0, 0, 1, 1},
  {&__pyx_n_u_uint32, __pyx_k_uint32, sizeof(__pyx_k_uint32), 0, 1, 0, 1},
  {&__pyx_n_s_uint64, __pyx_k_uint64, sizeof(__pyx_k_uint64), 0, 0, 1, 1},
  {&__pyx_n_u_uint64, __pyx_k_uint64, sizeof(__pyx_k_uint64), 0, 1, 0, 1},
  {&__pyx_n_s_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1},
  {&__pyx_n_u_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 1, 0, 1},
  {&__pyx_n_u_uncompressed, __pyx_k_uncompressed, sizeof(__pyx_k_uncompressed), 0, 1, 0, 1},
  {&__pyx_n_s_union, __pyx_k_union, sizeof(__pyx_k_union), 0, 0, 1, 1},
  {&__pyx_n_s_union_type, __pyx_k_union_type, sizeof(__pyx_k_union_type), 0, 0, 1, 1},
  {&__pyx_n_s_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_u_unknown_driver_r, __pyx_k_unknown_driver_r, sizeof(__pyx_k_unknown_driver_r), 0, 1, 0, 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_u_us, __pyx_k_us, sizeof(__pyx_k_us), 0, 1, 0, 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_u_utc, __pyx_k_utc, sizeof(__pyx_k_utc), 0, 1, 0, 1},
  {&__pyx_n_s_utcfromtimestamp, __pyx_k_utcfromtimestamp, sizeof(__pyx_k_utcfromtimestamp), 0, 0, 1, 1},
  {&__pyx_n_s_utcoffset, __pyx_k_utcoffset, sizeof(__pyx_k_utcoffset), 0, 0, 1, 1},
  {&__pyx_n_s_utf8, __pyx_k_utf8, sizeof(__pyx_k_utf8), 0, 0, 1, 1},
  {&__pyx_n_u_utf8, __pyx_k_utf8, sizeof(__pyx_k_utf8), 0, 1, 0, 1},
  {&__pyx_n_s_util, __pyx_k_util, sizeof(__pyx_k_util), 0, 0, 1, 1},
  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
  {&__pyx_n_s_value_offsets, __pyx_k_value_offsets, sizeof(__pyx_k_value_offsets), 0, 0, 1, 1},
  {&__pyx_n_s_value_type, __pyx_k_value_type, sizeof(__pyx_k_value_type), 0, 0, 1, 1},
  {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
  {&__pyx_n_s_values_2, __pyx_k_values_2, sizeof(__pyx_k_values_2), 0, 0, 1, 1},
  {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1},
  {&__pyx_n_u_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 1, 0, 1},
  {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1},
  {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1},
  {&__pyx_n_u_wb, __pyx_k_wb, sizeof(__pyx_k_wb), 0, 1, 0, 1},
  {&__pyx_n_s_weakref, __pyx_k_weakref, sizeof(__pyx_k_weakref), 0, 0, 1, 1},
  {&__pyx_n_s_whence, __pyx_k_whence, sizeof(__pyx_k_whence), 0, 0, 1, 1},
  {&__pyx_n_s_window, __pyx_k_window, sizeof(__pyx_k_window), 0, 0, 1, 1},
  {&__pyx_n_s_wrapped_value, __pyx_k_wrapped_value, sizeof(__pyx_k_wrapped_value), 0, 0, 1, 1},
  {&__pyx_n_s_writable, __pyx_k_writable, sizeof(__pyx_k_writable), 0, 0, 1, 1},
  {&__pyx_kp_u_writable_file_expected, __pyx_k_writable_file_expected, sizeof(__pyx_k_writable_file_expected), 0, 1, 0, 0},
  {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
  {&__pyx_n_u_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 1, 0, 1},
  {&__pyx_n_s_write_batch, __pyx_k_write_batch, sizeof(__pyx_k_write_batch), 0, 0, 1, 1},
  {&__pyx_n_s_write_table, __pyx_k_write_table, sizeof(__pyx_k_write_table), 0, 0, 1, 1},
  {&__pyx_n_s_write_tensor, __pyx_k_write_tensor, sizeof(__pyx_k_write_tensor), 0, 0, 1, 1},
  {&__pyx_n_s_write_to, __pyx_k_write_to, sizeof(__pyx_k_write_to), 0, 0, 1, 1},
  {&__pyx_n_s_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_kp_u_zst, __pyx_k_zst, sizeof(__pyx_k_zst), 0, 1, 0, 0},
  {&__pyx_n_u_zstd, __pyx_k_zstd, sizeof(__pyx_k_zstd), 0, 1, 0, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 27, __pyx_L1_error)
  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 31, __pyx_L1_error)
  __pyx_builtin_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_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(1, 509, __pyx_L1_error)
  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 26, __pyx_L1_error)
  __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(3, 116, __pyx_L1_error)
  __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s_NotImplemented); if (!__pyx_builtin_NotImplemented) __PYX_ERR(4, 141, __pyx_L1_error)
  __pyx_builtin_UserWarning = __Pyx_GetBuiltinName(__pyx_n_s_UserWarning); if (!__pyx_builtin_UserWarning) __PYX_ERR(4, 258, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(4, 273, __pyx_L1_error)
  __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(4, 755, __pyx_L1_error)
  __pyx_builtin_map = __Pyx_GetBuiltinName(__pyx_n_s_map); if (!__pyx_builtin_map) __PYX_ERR(4, 1177, __pyx_L1_error)
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(4, 1535, __pyx_L1_error)
  __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(5, 76, __pyx_L1_error)
  __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(5, 485, __pyx_L1_error)
  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(1, 60, __pyx_L1_error)
  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 222, __pyx_L1_error)
  __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(6, 445, __pyx_L1_error)
  __pyx_builtin_BufferError = __Pyx_GetBuiltinName(__pyx_n_s_BufferError); if (!__pyx_builtin_BufferError) __PYX_ERR(6, 965, __pyx_L1_error)
  __pyx_builtin_SystemError = __Pyx_GetBuiltinName(__pyx_n_s_SystemError); if (!__pyx_builtin_SystemError) __PYX_ERR(6, 986, __pyx_L1_error)
  __pyx_builtin_FutureWarning = __Pyx_GetBuiltinName(__pyx_n_s_FutureWarning); if (!__pyx_builtin_FutureWarning) __PYX_ERR(7, 271, __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":60
 *     """
 *     if count < 1:
 *         raise ValueError("CPU count must be strictly positive")             # <<<<<<<<<<<<<<
 *     check_status(SetCpuThreadPoolCapacity(count))
 * 
 */
  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_CPU_count_must_be_strictly_posit); if (unlikely(!__pyx_tuple_)) __PYX_ERR(8, 60, __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__3 = PyTuple_Pack(1, __pyx_kp_s_self_pool_cannot_be_converted_to); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "(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__4 = PyTuple_Pack(1, __pyx_kp_s_self_pool_cannot_be_converted_to); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_self_logging_pool_self_pool_cann); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "(tree fragment)":4
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_self_logging_pool_self_pool_cann); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "(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__7 = PyTuple_Pack(1, __pyx_kp_s_self_pool_self_proxy_pool_cannot); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);

  /* "(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__8 = PyTuple_Pack(1, __pyx_kp_s_self_pool_self_proxy_pool_cannot); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);

  /* "pyarrow/types.pxi":122
 *         ty = dynamic_cast[_CFixedWidthTypePtr](self.type)
 *         if ty == nullptr:
 *             raise ValueError("Non-fixed width type")             # <<<<<<<<<<<<<<
 *         return ty.bit_width()
 * 
 */
  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Non_fixed_width_type); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(4, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

  /* "pyarrow/types.pxi":257
 *             raise KeyError(name)
 *         elif fields.size() > 1:
 *             warnings.warn("Struct field name corresponds to more "             # <<<<<<<<<<<<<<
 *                           "than one field", UserWarning)
 *             raise KeyError(name)
 */
  __pyx_tuple__11 = PyTuple_Pack(2, __pyx_kp_u_Struct_field_name_corresponds_to, __pyx_builtin_UserWarning); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(4, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);

  /* "pyarrow/types.pxi":285
 *             return self.child(i)
 *         else:
 *             raise TypeError('Expected integer or string index')             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_Expected_integer_or_string_index); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(4, 285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

  /* "pyarrow/types.pxi":492
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call Field's constructor directly, use "             # <<<<<<<<<<<<<<
 *                         "`pyarrow.field` instead.")
 * 
 */
  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_Do_not_call_Field_s_constructor); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(4, 492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "pyarrow/types.pxi":562
 * 
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')             # <<<<<<<<<<<<<<
 * 
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 */
  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_u_Metadata_must_be_an_instance_of); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(4, 562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);

  /* "pyarrow/types.pxi":604
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call Schema's constructor directly, use "             # <<<<<<<<<<<<<<
 *                         "`pyarrow.schema` instead.")
 * 
 */
  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_Do_not_call_Schema_s_constructor); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(4, 604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "pyarrow/types.pxi":778
 *             return None
 *         elif results.size() > 1:
 *             warnings.warn("Schema field name corresponds to more "             # <<<<<<<<<<<<<<
 *                           "than one field", UserWarning)
 *             return None
 */
  __pyx_tuple__16 = PyTuple_Pack(2, __pyx_kp_u_Schema_field_name_corresponds_to, __pyx_builtin_UserWarning); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(4, 778, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);

  /* "pyarrow/types.pxi":1136
 *         hours, minutes = divmod(minutes, 60)
 *         if seconds > 0:
 *             raise ValueError('Offset must represent whole number of minutes')             # <<<<<<<<<<<<<<
 *         return '{}{:02d}:{:02d}'.format(sign, hours, minutes)
 * 
 */
  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_u_Offset_must_represent_whole_numb); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(4, 1136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);

  /* "pyarrow/types.pxi":1130
 *     import datetime
 * 
 *     def fixed_offset_to_string(offset):             # <<<<<<<<<<<<<<
 *         seconds = int(offset.utcoffset(None).total_seconds())
 *         sign = '+' if seconds >= 0 else '-'
 */
  __pyx_tuple__20 = PyTuple_Pack(5, __pyx_n_s_offset, __pyx_n_s_seconds, __pyx_n_s_sign, __pyx_n_s_minutes, __pyx_n_s_hours); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(4, 1130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);
  __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_fixed_offset_to_string, 1130, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(4, 1130, __pyx_L1_error)

  /* "pyarrow/types.pxi":1152
 *                              .format(tz))
 *     else:
 *         raise TypeError('Must be an instance of `datetime.tzinfo`')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_u_Must_be_an_instance_of_datetime); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(4, 1152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);

  /* "pyarrow/types.pxi":1177
 *     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__23 = PyTuple_Pack(2, __pyx_int_2, __pyx_int_3); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(4, 1177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

  /* "pyarrow/types.pxi":1219
 *         unit_code = TimeUnit_NANO
 *     else:
 *         raise ValueError('Invalid TimeUnit string')             # <<<<<<<<<<<<<<
 * 
 *     cdef TimestampType out = TimestampType.__new__(TimestampType)
 */
  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_u_Invalid_TimeUnit_string); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(4, 1219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);

  /* "pyarrow/types.pxi":1364
 *     cdef shared_ptr[CDataType] decimal_type
 *     if precision < 1 or precision > 38:
 *         raise ValueError("precision should be between 1 and 38")             # <<<<<<<<<<<<<<
 *     decimal_type.reset(new CDecimal128Type(precision, scale))
 *     return pyarrow_wrap_data_type(decimal_type)
 */
  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_u_precision_should_be_between_1_an); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(4, 1364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);

  /* "pyarrow/types.pxi":1425
 *         list_type.reset(new CListType((<Field> value_type).sp_field))
 *     else:
 *         raise TypeError('List requires DataType or Field')             # <<<<<<<<<<<<<<
 * 
 *     out.init(list_type)
 */
  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_u_List_requires_DataType_or_Field); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(4, 1425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

  /* "pyarrow/types.pxi":1668
 *             py_field = item
 *         if py_field is None:
 *             raise TypeError("field or tuple expected, got None")             # <<<<<<<<<<<<<<
 *         c_fields.push_back(py_field.sp_field)
 * 
 */
  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_u_field_or_tuple_expected_got_None); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(4, 1668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "pyarrow/scalar.pxi":36
 *         global NA
 *         if NA is not None:
 *             raise Exception('Cannot create multiple NAType instances')             # <<<<<<<<<<<<<<
 * 
 *         self.type = null()
 */
  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_u_Cannot_create_multiple_NAType_in); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(5, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);

  /* "(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__29 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);

  /* "(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__30 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__30);
  __Pyx_GIVEREF(__pyx_tuple__30);

  /* "pyarrow/scalar.pxi":90
 *             return self.as_py() == other
 *         else:
 *             raise NotImplementedError(             # <<<<<<<<<<<<<<
 *                 "Cannot compare Arrow values that don't support as_py()")
 * 
 */
  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_u_Cannot_compare_Arrow_values_that); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(5, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__31);
  __Pyx_GIVEREF(__pyx_tuple__31);

  /* "(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__32 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__32);
  __Pyx_GIVEREF(__pyx_tuple__32);

  /* "(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__33 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__33);
  __Pyx_GIVEREF(__pyx_tuple__33);

  /* "(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__34 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);

  /* "(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__35 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);

  /* "(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__36 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);

  /* "(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__37 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);

  /* "(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__38 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__38);
  __Pyx_GIVEREF(__pyx_tuple__38);

  /* "(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__39 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__39);
  __Pyx_GIVEREF(__pyx_tuple__39);

  /* "(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__40 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);

  /* "(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__41 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__41);
  __Pyx_GIVEREF(__pyx_tuple__41);

  /* "(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__42 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);

  /* "(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__43 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__43);
  __Pyx_GIVEREF(__pyx_tuple__43);

  /* "(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__44 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);

  /* "(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__45 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(9, 4, __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(9, 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(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__47);
  __Pyx_GIVEREF(__pyx_tuple__47);

  /* "(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(9, 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(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);

  /* "(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__50 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__50);
  __Pyx_GIVEREF(__pyx_tuple__50);

  /* "(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__51 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__51);
  __Pyx_GIVEREF(__pyx_tuple__51);

  /* "(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__52 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__52);
  __Pyx_GIVEREF(__pyx_tuple__52);

  /* "(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__53 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__53);
  __Pyx_GIVEREF(__pyx_tuple__53);

  /* "(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__54 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);

  /* "(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__55 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__55);
  __Pyx_GIVEREF(__pyx_tuple__55);

  /* "pyarrow/scalar.pxi":259
 *         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__56 = PyTuple_Pack(3, __pyx_int_1970, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(5, 259, __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(9, 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(9, 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(9, 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(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__60);
  __Pyx_GIVEREF(__pyx_tuple__60);

  /* "pyarrow/scalar.pxi":359
 *             converter = _datetime_conversion_functions()[dtype.unit()]
 *         except KeyError:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 'Cannot convert nanosecond timestamps without pandas'
 *             )
 */
  __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_u_Cannot_convert_nanosecond_timest); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(5, 359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__61);
  __Pyx_GIVEREF(__pyx_tuple__61);

  /* "(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__62 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__62);
  __Pyx_GIVEREF(__pyx_tuple__62);

  /* "(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__63 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__63);
  __Pyx_GIVEREF(__pyx_tuple__63);

  /* "(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__64 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);

  /* "(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__65 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__65);
  __Pyx_GIVEREF(__pyx_tuple__65);

  /* "(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__66 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__66);
  __Pyx_GIVEREF(__pyx_tuple__66);

  /* "(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__67 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__67);
  __Pyx_GIVEREF(__pyx_tuple__67);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__68);
  __Pyx_GIVEREF(__pyx_tuple__68);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__69);
  __Pyx_GIVEREF(__pyx_tuple__69);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__70 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__70);
  __Pyx_GIVEREF(__pyx_tuple__70);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__71);
  __Pyx_GIVEREF(__pyx_tuple__71);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__72 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__72);
  __Pyx_GIVEREF(__pyx_tuple__72);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__73 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__73);
  __Pyx_GIVEREF(__pyx_tuple__73);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__74 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__74);
  __Pyx_GIVEREF(__pyx_tuple__74);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__75 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__75);
  __Pyx_GIVEREF(__pyx_tuple__75);

  /* "(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__76 = PyTuple_Pack(1, __pyx_kp_s_self_ap_self_sp_array_cannot_be); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__76);
  __Pyx_GIVEREF(__pyx_tuple__76);

  /* "(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__77 = PyTuple_Pack(1, __pyx_kp_s_self_ap_self_sp_array_cannot_be); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__77);
  __Pyx_GIVEREF(__pyx_tuple__77);

  /* "(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__78 = PyTuple_Pack(1, __pyx_kp_s_self_ap_self_sp_array_cannot_be); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__78);
  __Pyx_GIVEREF(__pyx_tuple__78);

  /* "(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__79 = PyTuple_Pack(1, __pyx_kp_s_self_ap_self_sp_array_cannot_be); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__79);
  __Pyx_GIVEREF(__pyx_tuple__79);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__80 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__80);
  __Pyx_GIVEREF(__pyx_tuple__80);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__81);
  __Pyx_GIVEREF(__pyx_tuple__81);

  /* "(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__82 = PyTuple_Pack(1, __pyx_kp_s_self_ap_self_sp_array_cannot_be); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__82);
  __Pyx_GIVEREF(__pyx_tuple__82);

  /* "(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__83 = PyTuple_Pack(1, __pyx_kp_s_self_ap_self_sp_array_cannot_be); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__83);
  __Pyx_GIVEREF(__pyx_tuple__83);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__84);
  __Pyx_GIVEREF(__pyx_tuple__84);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__85);
  __Pyx_GIVEREF(__pyx_tuple__85);

  /* "pyarrow/scalar.pxi":695
 *             return self.as_py() == other
 *         else:
 *             raise NotImplemented(             # <<<<<<<<<<<<<<
 *                 "Cannot compare scalars that don't support as_py()")
 * 
 */
  __pyx_tuple__86 = PyTuple_Pack(1, __pyx_kp_u_Cannot_compare_scalars_that_don); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(5, 695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__86);
  __Pyx_GIVEREF(__pyx_tuple__86);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__87 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__87);
  __Pyx_GIVEREF(__pyx_tuple__87);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__88 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__88);
  __Pyx_GIVEREF(__pyx_tuple__88);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__89 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__89);
  __Pyx_GIVEREF(__pyx_tuple__89);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__90 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__90);
  __Pyx_GIVEREF(__pyx_tuple__90);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__91 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__91);
  __Pyx_GIVEREF(__pyx_tuple__91);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__92 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__92);
  __Pyx_GIVEREF(__pyx_tuple__92);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__93 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__93);
  __Pyx_GIVEREF(__pyx_tuple__93);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__94 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__94);
  __Pyx_GIVEREF(__pyx_tuple__94);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__95 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__95);
  __Pyx_GIVEREF(__pyx_tuple__95);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__96 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__96);
  __Pyx_GIVEREF(__pyx_tuple__96);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__97 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__97);
  __Pyx_GIVEREF(__pyx_tuple__97);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__98 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__98);
  __Pyx_GIVEREF(__pyx_tuple__98);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__99 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__99);
  __Pyx_GIVEREF(__pyx_tuple__99);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__100 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__100);
  __Pyx_GIVEREF(__pyx_tuple__100);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__101 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__101);
  __Pyx_GIVEREF(__pyx_tuple__101);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__102 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__102);
  __Pyx_GIVEREF(__pyx_tuple__102);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__103 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__103);
  __Pyx_GIVEREF(__pyx_tuple__103);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__104 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__104);
  __Pyx_GIVEREF(__pyx_tuple__104);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__105 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__105);
  __Pyx_GIVEREF(__pyx_tuple__105);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__106 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__106);
  __Pyx_GIVEREF(__pyx_tuple__106);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__107 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__107);
  __Pyx_GIVEREF(__pyx_tuple__107);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__108 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__108);
  __Pyx_GIVEREF(__pyx_tuple__108);

  /* "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__109 = PyTuple_Pack(1, __pyx_kp_u_only_slices_with_step_1_supporte); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(1, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__109);
  __Pyx_GIVEREF(__pyx_tuple__109);

  /* "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__110 = PyTuple_Pack(1, __pyx_kp_u_index_out_of_bounds); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(1, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__110);
  __Pyx_GIVEREF(__pyx_tuple__110);

  /* "(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__111 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__111);
  __Pyx_GIVEREF(__pyx_tuple__111);

  /* "(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__112 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__112);
  __Pyx_GIVEREF(__pyx_tuple__112);

  /* "pyarrow/array.pxi":259
 *         return pyarrow_wrap_scalar(datum.scalar())
 *     else:
 *         raise ValueError("Unable to wrap Datum in a Python object")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__113 = PyTuple_Pack(1, __pyx_kp_u_Unable_to_wrap_Datum_in_a_Python); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(1, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__113);
  __Pyx_GIVEREF(__pyx_tuple__113);

  /* "pyarrow/array.pxi":410
 * 
 *     def __eq__(self, other):
 *         raise NotImplementedError('Comparisons with pyarrow.Array are not '             # <<<<<<<<<<<<<<
 *                                   'implemented')
 * 
 */
  __pyx_tuple__114 = PyTuple_Pack(1, __pyx_kp_u_Comparisons_with_pyarrow_Array_a); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(1, 410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__114);
  __Pyx_GIVEREF(__pyx_tuple__114);

  /* "pyarrow/array.pxi":578
 * 
 *         if not is_primitive(type.id):
 *             raise NotImplementedError("from_buffers is only supported for "             # <<<<<<<<<<<<<<
 *                                       "primitive arrays yet.")
 * 
 */
  __pyx_tuple__115 = PyTuple_Pack(1, __pyx_kp_u_from_buffers_is_only_supported_f); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(1, 578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__115);
  __Pyx_GIVEREF(__pyx_tuple__115);

  /* "pyarrow/array.pxi":669
 * 
 *         if offset < 0:
 *             raise IndexError('Offset must be non-negative')             # <<<<<<<<<<<<<<
 * 
 *         if length is None:
 */
  __pyx_tuple__116 = PyTuple_Pack(1, __pyx_kp_u_Offset_must_be_non_negative); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(1, 669, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__116);
  __Pyx_GIVEREF(__pyx_tuple__116);

  /* "pyarrow/array.pxi":704
 *         """
 *         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__117 = PyTuple_Pack(1, __pyx_kp_u_NumPy_array_view_is_only_support); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(1, 704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__117);
  __Pyx_GIVEREF(__pyx_tuple__117);

  /* "pyarrow/array.pxi":707
 *                                       '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__118 = PyTuple_Pack(1, __pyx_kp_u_NumPy_array_view_is_only_support_2); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(1, 707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__118);
  __Pyx_GIVEREF(__pyx_tuple__118);

  /* "pyarrow/array.pxi":765
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call Tensor's constructor directly, use one "             # <<<<<<<<<<<<<<
 *                         "of the `pyarrow.Tensor.from_*` functions instead.")
 * 
 */
  __pyx_tuple__119 = PyTuple_Pack(1, __pyx_kp_u_Do_not_call_Tensor_s_constructor); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(1, 765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__119);
  __Pyx_GIVEREF(__pyx_tuple__119);

  /* "(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__120 = PyTuple_Pack(1, __pyx_kp_s_self_sp_tensor_self_tp_cannot_be); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__120);
  __Pyx_GIVEREF(__pyx_tuple__120);

  /* "(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__121 = PyTuple_Pack(1, __pyx_kp_s_self_sp_tensor_self_tp_cannot_be); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__121);
  __Pyx_GIVEREF(__pyx_tuple__121);

  /* "pyarrow/array.pxi":1215
 *         if isinstance(indices, Array):
 *             if mask is not None:
 *                 raise NotImplementedError(             # <<<<<<<<<<<<<<
 *                     "mask not implemented with Arrow array inputs yet")
 *             _indices = indices
 */
  __pyx_tuple__122 = PyTuple_Pack(1, __pyx_kp_u_mask_not_implemented_with_Arrow); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(1, 1215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__122);
  __Pyx_GIVEREF(__pyx_tuple__122);

  /* "pyarrow/array.pxi":1232
 * 
 *         if not isinstance(_indices, IntegerArray):
 *             raise ValueError('Indices must be integer type')             # <<<<<<<<<<<<<<
 * 
 *         cdef c_bool c_ordered = ordered
 */
  __pyx_tuple__123 = PyTuple_Pack(1, __pyx_kp_u_Indices_must_be_integer_type); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(1, 1232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__123);
  __Pyx_GIVEREF(__pyx_tuple__123);

  /* "pyarrow/array.pxi":1335
 * 
 *         if names is None:
 *             raise ValueError('Names are currently required')             # <<<<<<<<<<<<<<
 * 
 *         arrays = [asarray(x) for x in arrays]
 */
  __pyx_tuple__124 = PyTuple_Pack(1, __pyx_kp_u_Names_are_currently_required); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(1, 1335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__124);
  __Pyx_GIVEREF(__pyx_tuple__124);

  /* "pyarrow/array.pxi":1341
 *         num_arrays = len(arrays)
 *         if num_arrays != len(names):
 *             raise ValueError("The number of names should be equal to the "             # <<<<<<<<<<<<<<
 *                              "number of arrays")
 * 
 */
  __pyx_tuple__125 = PyTuple_Pack(1, __pyx_kp_u_The_number_of_names_should_be_eq); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(1, 1341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__125);
  __Pyx_GIVEREF(__pyx_tuple__125);

  /* "pyarrow/array.pxi":1350
 *                 array = arrays[i]
 *                 if len(array) != length:
 *                     raise ValueError("All arrays must have the same length")             # <<<<<<<<<<<<<<
 *                 c_arrays[i] = array.sp_array
 *         else:
 */
  __pyx_tuple__126 = PyTuple_Pack(1, __pyx_kp_u_All_arrays_must_have_the_same_le); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(1, 1350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__126);
  __Pyx_GIVEREF(__pyx_tuple__126);

  /* "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__127 = PyTuple_Pack(1, __pyx_kp_u_StringBuilder_only_accepts_strin); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(11, 51, __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(9, 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(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__129);
  __Pyx_GIVEREF(__pyx_tuple__129);

  /* "pyarrow/table.pxi":31
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call ChunkedArray's constructor directly, use "             # <<<<<<<<<<<<<<
 *                         "`chunked_array` function instead.")
 * 
 */
  __pyx_tuple__130 = PyTuple_Pack(1, __pyx_kp_u_Do_not_call_ChunkedArray_s_const); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(12, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__130);
  __Pyx_GIVEREF(__pyx_tuple__130);

  /* "pyarrow/table.pxi":95
 *             return self.getitem(key)
 *         else:
 *             raise TypeError("key must either be a slice or integer")             # <<<<<<<<<<<<<<
 * 
 *     cdef getitem(self, int64_t i):
 */
  __pyx_tuple__131 = PyTuple_Pack(1, __pyx_kp_u_key_must_either_be_a_slice_or_in); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(12, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__131);
  __Pyx_GIVEREF(__pyx_tuple__131);

  /* "pyarrow/table.pxi":242
 *         """
 *         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__132 = PyTuple_Pack(1, __pyx_kp_u_Chunk_index_out_of_range); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(12, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__132);
  __Pyx_GIVEREF(__pyx_tuple__132);

  /* "pyarrow/table.pxi":298
 *     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__133 = PyTuple_Pack(1, __pyx_kp_u_Cannot_construct_a_chunked_array); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(12, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__133);
  __Pyx_GIVEREF(__pyx_tuple__133);

  /* "pyarrow/table.pxi":331
 *         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__134 = PyTuple_Pack(1, __pyx_kp_u_Passed_field_type_does_not_match); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(12, 331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__134);
  __Pyx_GIVEREF(__pyx_tuple__134);

  /* "pyarrow/table.pxi":362
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call Column's constructor directly, use one "             # <<<<<<<<<<<<<<
 *                         "of the `Column.from_*` functions instead.")
 * 
 */
  __pyx_tuple__135 = PyTuple_Pack(1, __pyx_kp_u_Do_not_call_Column_s_constructor); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(12, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__135);
  __Pyx_GIVEREF(__pyx_tuple__135);

  /* "pyarrow/table.pxi":606
 *     else:
 *         if names is None:
 *             raise ValueError('Must pass names when constructing '             # <<<<<<<<<<<<<<
 *                              'from Array objects')
 *         if len(names) != K:
 */
  __pyx_tuple__137 = PyTuple_Pack(1, __pyx_kp_u_Must_pass_names_when_constructin); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(12, 606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__137);
  __Pyx_GIVEREF(__pyx_tuple__137);

  /* "pyarrow/table.pxi":642
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call RecordBatch's constructor directly, use "             # <<<<<<<<<<<<<<
 *                         "one of the `RecordBatch.from_*` functions instead.")
 * 
 */
  __pyx_tuple__138 = PyTuple_Pack(1, __pyx_kp_u_Do_not_call_RecordBatch_s_constr); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(12, 642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__138);
  __Pyx_GIVEREF(__pyx_tuple__138);

  /* "pyarrow/table.pxi":950
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call Table's constructor directly, use one of "             # <<<<<<<<<<<<<<
 *                         "the `Table.from_*` functions instead.")
 * 
 */
  __pyx_tuple__139 = PyTuple_Pack(1, __pyx_kp_u_Do_not_call_Table_s_constructor); if (unlikely(!__pyx_tuple__139)) __PYX_ERR(12, 950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__139);
  __Pyx_GIVEREF(__pyx_tuple__139);

  /* "pyarrow/table.pxi":1179
 *         elif schema is not None:
 *             if names is not None:
 *                 raise ValueError('Cannot pass schema and arrays')             # <<<<<<<<<<<<<<
 *             cy_schema = schema
 * 
 */
  __pyx_tuple__140 = PyTuple_Pack(1, __pyx_kp_u_Cannot_pass_schema_and_arrays); if (unlikely(!__pyx_tuple__140)) __PYX_ERR(12, 1179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__140);
  __Pyx_GIVEREF(__pyx_tuple__140);

  /* "pyarrow/table.pxi":1183
 * 
 *             if len(schema) != len(arrays):
 *                 raise ValueError('Schema and number of arrays unequal')             # <<<<<<<<<<<<<<
 * 
 *             c_schema = cy_schema.sp_schema
 */
  __pyx_tuple__141 = PyTuple_Pack(1, __pyx_kp_u_Schema_and_number_of_arrays_uneq); if (unlikely(!__pyx_tuple__141)) __PYX_ERR(12, 1183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__141);
  __Pyx_GIVEREF(__pyx_tuple__141);

  /* "pyarrow/table.pxi":1244
 *         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__142 = PyTuple_Pack(1, __pyx_kp_u_Must_pass_schema_or_at_least_one); if (unlikely(!__pyx_tuple__142)) __PYX_ERR(12, 1244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__142);
  __Pyx_GIVEREF(__pyx_tuple__142);

  /* "pyarrow/table.pxi":1353
 *             return self._column(i)
 *         else:
 *             raise TypeError("Index must either be string or integer")             # <<<<<<<<<<<<<<
 * 
 *     def _column(self, int i):
 */
  __pyx_tuple__143 = PyTuple_Pack(1, __pyx_kp_u_Index_must_either_be_string_or_i); if (unlikely(!__pyx_tuple__143)) __PYX_ERR(12, 1353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__143);
  __Pyx_GIVEREF(__pyx_tuple__143);

  /* "pyarrow/io.pxi":91
 *             return 'wb'
 *         else:
 *             raise ValueError('File object is malformed, has no mode')             # <<<<<<<<<<<<<<
 * 
 *     def readable(self):
 */
  __pyx_tuple__144 = PyTuple_Pack(1, __pyx_kp_u_File_object_is_malformed_has_no); if (unlikely(!__pyx_tuple__144)) __PYX_ERR(6, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__144);
  __Pyx_GIVEREF(__pyx_tuple__144);

  /* "pyarrow/io.pxi":166
 *     def _assert_open(self):
 *         if self.closed:
 *             raise ValueError("I/O operation on closed file")             # <<<<<<<<<<<<<<
 * 
 *     def _assert_readable(self):
 */
  __pyx_tuple__145 = PyTuple_Pack(1, __pyx_kp_u_I_O_operation_on_closed_file); if (unlikely(!__pyx_tuple__145)) __PYX_ERR(6, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__145);
  __Pyx_GIVEREF(__pyx_tuple__145);

  /* "pyarrow/io.pxi":172
 *         if not self.is_readable:
 *             # XXX UnsupportedOperation
 *             raise IOError("only valid on readonly files")             # <<<<<<<<<<<<<<
 * 
 *     def _assert_writable(self):
 */
  __pyx_tuple__146 = PyTuple_Pack(1, __pyx_kp_u_only_valid_on_readonly_files); if (unlikely(!__pyx_tuple__146)) __PYX_ERR(6, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__146);
  __Pyx_GIVEREF(__pyx_tuple__146);

  /* "pyarrow/io.pxi":177
 *         self._assert_open()
 *         if not self.is_writable:
 *             raise IOError("only valid on writable files")             # <<<<<<<<<<<<<<
 * 
 *     def _assert_seekable(self):
 */
  __pyx_tuple__147 = PyTuple_Pack(1, __pyx_kp_u_only_valid_on_writable_files); if (unlikely(!__pyx_tuple__147)) __PYX_ERR(6, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__147);
  __Pyx_GIVEREF(__pyx_tuple__147);

  /* "pyarrow/io.pxi":182
 *         self._assert_open()
 *         if not self.is_seekable:
 *             raise IOError("only valid on seekable files")             # <<<<<<<<<<<<<<
 * 
 *     def size(self):
 */
  __pyx_tuple__148 = PyTuple_Pack(1, __pyx_kp_u_only_valid_on_seekable_files); if (unlikely(!__pyx_tuple__148)) __PYX_ERR(6, 182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__148);
  __Pyx_GIVEREF(__pyx_tuple__148);

  /* "pyarrow/io.pxi":447
 *             stream = open(stream_or_path, 'wb')
 * 
 *             def cleanup():             # <<<<<<<<<<<<<<
 *                 stream.close()
 *         else:
 */
  __pyx_codeobj__150 = (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, 447, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__150)) __PYX_ERR(6, 447, __pyx_L1_error)

  /* "pyarrow/io.pxi":452
 *             stream = stream_or_path
 * 
 *             def cleanup():             # <<<<<<<<<<<<<<
 *                 pass
 * 
 */
  __pyx_codeobj__151 = (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, 452, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__151)) __PYX_ERR(6, 452, __pyx_L1_error)

  /* "pyarrow/io.pxi":458
 *         exc_info = None
 * 
 *         def bg_write():             # <<<<<<<<<<<<<<
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 */
  __pyx_tuple__152 = PyTuple_Pack(3, __pyx_n_s_buf, __pyx_n_s_e, __pyx_n_s_exc_info); if (unlikely(!__pyx_tuple__152)) __PYX_ERR(6, 458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__152);
  __Pyx_GIVEREF(__pyx_tuple__152);
  __pyx_codeobj__153 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__152, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_bg_write, 458, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__153)) __PYX_ERR(6, 458, __pyx_L1_error)

  /* "pyarrow/io.pxi":529
 *         exc_info = None
 * 
 *         def bg_write():             # <<<<<<<<<<<<<<
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 */
  __pyx_tuple__154 = PyTuple_Pack(3, __pyx_n_s_buf, __pyx_n_s_e, __pyx_n_s_exc_info); if (unlikely(!__pyx_tuple__154)) __PYX_ERR(6, 529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__154);
  __Pyx_GIVEREF(__pyx_tuple__154);
  __pyx_codeobj__155 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__154, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_bg_write, 529, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__155)) __PYX_ERR(6, 529, __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__156 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__156)) __PYX_ERR(9, 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(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__157);
  __Pyx_GIVEREF(__pyx_tuple__157);

  /* "pyarrow/io.pxi":616
 *                 if kind == 'r':
 *                     if not handle.readable():
 *                         raise TypeError("readable file expected")             # <<<<<<<<<<<<<<
 *                 else:
 *                     if not handle.writable():
 */
  __pyx_tuple__158 = PyTuple_Pack(1, __pyx_kp_u_readable_file_expected); if (unlikely(!__pyx_tuple__158)) __PYX_ERR(6, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__158);
  __Pyx_GIVEREF(__pyx_tuple__158);

  /* "pyarrow/io.pxi":619
 *                 else:
 *                     if not handle.writable():
 *                         raise TypeError("writable file expected")             # <<<<<<<<<<<<<<
 *             elif file_type is not None and isinstance(handle, file_type):
 *                 # Python 2 file type
 */
  __pyx_tuple__159 = PyTuple_Pack(1, __pyx_kp_u_writable_file_expected); if (unlikely(!__pyx_tuple__159)) __PYX_ERR(6, 619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__159);
  __Pyx_GIVEREF(__pyx_tuple__159);

  /* "(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__160 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__160)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__160);
  __Pyx_GIVEREF(__pyx_tuple__160);

  /* "(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__161 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__161)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__161);
  __Pyx_GIVEREF(__pyx_tuple__161);

  /* "(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__162 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__162)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__162);
  __Pyx_GIVEREF(__pyx_tuple__162);

  /* "(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__163 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__163)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__163);
  __Pyx_GIVEREF(__pyx_tuple__163);

  /* "(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__164 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__164)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__164);
  __Pyx_GIVEREF(__pyx_tuple__164);

  /* "(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__165 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__165)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__165);
  __Pyx_GIVEREF(__pyx_tuple__165);

  /* "(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__166 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__166)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__166);
  __Pyx_GIVEREF(__pyx_tuple__166);

  /* "(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__167 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__167)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__167);
  __Pyx_GIVEREF(__pyx_tuple__167);

  /* "pyarrow/io.pxi":842
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call Buffer's constructor directly, use "             # <<<<<<<<<<<<<<
 *                         "`pyarrow.py_buffer` function instead.")
 * 
 */
  __pyx_tuple__168 = PyTuple_Pack(1, __pyx_kp_u_Do_not_call_Buffer_s_constructor); if (unlikely(!__pyx_tuple__168)) __PYX_ERR(6, 842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__168);
  __Pyx_GIVEREF(__pyx_tuple__168);

  /* "pyarrow/io.pxi":965
 *         else:
 *             if flags & cp.PyBUF_WRITABLE:
 *                 raise BufferError("Writable buffer requested but Arrow "             # <<<<<<<<<<<<<<
 *                                   "buffer was not mutable")
 *             buffer.readonly = 1
 */
  __pyx_tuple__169 = PyTuple_Pack(1, __pyx_kp_u_Writable_buffer_requested_but_Ar); if (unlikely(!__pyx_tuple__169)) __PYX_ERR(6, 965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__169);
  __Pyx_GIVEREF(__pyx_tuple__169);

  /* "pyarrow/io.pxi":986
 *     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__170 = PyTuple_Pack(1, __pyx_kp_u_accessing_non_existent_buffer_se); if (unlikely(!__pyx_tuple__170)) __PYX_ERR(6, 986, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__170);
  __Pyx_GIVEREF(__pyx_tuple__170);

  /* "pyarrow/io.pxi":993
 *     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__171 = PyTuple_Pack(1, __pyx_kp_u_trying_to_write_an_immutable_buf); if (unlikely(!__pyx_tuple__171)) __PYX_ERR(6, 993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__171);
  __Pyx_GIVEREF(__pyx_tuple__171);

  /* "(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__172 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__172)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__172);
  __Pyx_GIVEREF(__pyx_tuple__172);

  /* "(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__173 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__173)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__173);
  __Pyx_GIVEREF(__pyx_tuple__173);

  /* "(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__174 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__174)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__174);
  __Pyx_GIVEREF(__pyx_tuple__174);

  /* "(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__175 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__175)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__175);
  __Pyx_GIVEREF(__pyx_tuple__175);

  /* "(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__176 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__176)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__176);
  __Pyx_GIVEREF(__pyx_tuple__176);

  /* "(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__177 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__177)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__177);
  __Pyx_GIVEREF(__pyx_tuple__177);

  /* "(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__178 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__178)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__178);
  __Pyx_GIVEREF(__pyx_tuple__178);

  /* "(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__179 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__179)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__179);
  __Pyx_GIVEREF(__pyx_tuple__179);

  /* "(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__180 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__180)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__180);
  __Pyx_GIVEREF(__pyx_tuple__180);

  /* "(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__181 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__181)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__181);
  __Pyx_GIVEREF(__pyx_tuple__181);

  /* "pyarrow/io.pxi":1190
 * 
 *         if buffer_size <= 0:
 *             raise ValueError('Buffer size must be larger than zero')             # <<<<<<<<<<<<<<
 *         check_status(CBufferedInputStream.Create(
 *             buffer_size, maybe_unbox_memory_pool(memory_pool),
 */
  __pyx_tuple__182 = PyTuple_Pack(1, __pyx_kp_u_Buffer_size_must_be_larger_than); if (unlikely(!__pyx_tuple__182)) __PYX_ERR(6, 1190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__182);
  __Pyx_GIVEREF(__pyx_tuple__182);

  /* "(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__183 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__183)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__183);
  __Pyx_GIVEREF(__pyx_tuple__183);

  /* "(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__184 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__184)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__184);
  __Pyx_GIVEREF(__pyx_tuple__184);

  /* "(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__185 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__185)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__185);
  __Pyx_GIVEREF(__pyx_tuple__185);

  /* "(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__186 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__186)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__186);
  __Pyx_GIVEREF(__pyx_tuple__186);

  /* "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__187 = PyTuple_Pack(1, __pyx_kp_u_HDFS_client_improperly_initializ); if (unlikely(!__pyx_tuple__187)) __PYX_ERR(2, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__187);
  __Pyx_GIVEREF(__pyx_tuple__187);

  /* "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__188 = PyTuple_Pack(1, __pyx_kp_u_HDFS_client_is_closed); if (unlikely(!__pyx_tuple__188)) __PYX_ERR(2, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__188);
  __Pyx_GIVEREF(__pyx_tuple__188);

  /* "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__189 = PyTuple_Pack(1, __pyx_kp_u_Mode_must_be_rb_read_wb_write_ne); if (unlikely(!__pyx_tuple__189)) __PYX_ERR(2, 402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__189);
  __Pyx_GIVEREF(__pyx_tuple__189);

  /* "pyarrow/io-hdfs.pxi":451
 * 
 *     def download(self, path, stream, buffer_size=None):
 *         with self.open(path, 'rb') as f:             # <<<<<<<<<<<<<<
 *             f.download(stream, buffer_size=buffer_size)
 * 
 */
  __pyx_tuple__190 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__190)) __PYX_ERR(2, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__190);
  __Pyx_GIVEREF(__pyx_tuple__190);

  /* "(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__191 = PyTuple_Pack(1, __pyx_kp_s_self_client_cannot_be_converted); if (unlikely(!__pyx_tuple__191)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__191);
  __Pyx_GIVEREF(__pyx_tuple__191);

  /* "(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__192 = PyTuple_Pack(1, __pyx_kp_s_self_client_cannot_be_converted); if (unlikely(!__pyx_tuple__192)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__192);
  __Pyx_GIVEREF(__pyx_tuple__192);

  /* "(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__193 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__193)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__193);
  __Pyx_GIVEREF(__pyx_tuple__193);

  /* "(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__194 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__194)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__194);
  __Pyx_GIVEREF(__pyx_tuple__194);

  /* "(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__195 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__195)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__195);
  __Pyx_GIVEREF(__pyx_tuple__195);

  /* "(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__196 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__196)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__196);
  __Pyx_GIVEREF(__pyx_tuple__196);

  /* "(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__197 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__197)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__197);
  __Pyx_GIVEREF(__pyx_tuple__197);

  /* "(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__198 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__198)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__198);
  __Pyx_GIVEREF(__pyx_tuple__198);

  /* "(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__199 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__199)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__199);
  __Pyx_GIVEREF(__pyx_tuple__199);

  /* "(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__200 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__200)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__200);
  __Pyx_GIVEREF(__pyx_tuple__200);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__201 = PyTuple_Pack(1, __pyx_kp_s_self_writer_cannot_be_converted); if (unlikely(!__pyx_tuple__201)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__201);
  __Pyx_GIVEREF(__pyx_tuple__201);

  /* "(tree fragment)":4
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__202 = PyTuple_Pack(1, __pyx_kp_s_self_writer_cannot_be_converted); if (unlikely(!__pyx_tuple__202)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__202);
  __Pyx_GIVEREF(__pyx_tuple__202);

  /* "(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__203 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__203)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__203);
  __Pyx_GIVEREF(__pyx_tuple__203);

  /* "(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__204 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__204)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__204);
  __Pyx_GIVEREF(__pyx_tuple__204);

  /* "pyarrow/ipc.pxi":270
 *     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__205 = PyTuple_Pack(2, __pyx_kp_u_Please_use_read_next_batch_inste, __pyx_builtin_FutureWarning); if (unlikely(!__pyx_tuple__205)) __PYX_ERR(7, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__205);
  __Pyx_GIVEREF(__pyx_tuple__205);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__206 = PyTuple_Pack(1, __pyx_kp_s_self_reader_cannot_be_converted); if (unlikely(!__pyx_tuple__206)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__206);
  __Pyx_GIVEREF(__pyx_tuple__206);

  /* "(tree fragment)":4
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__207 = PyTuple_Pack(1, __pyx_kp_s_self_reader_cannot_be_converted); if (unlikely(!__pyx_tuple__207)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__207);
  __Pyx_GIVEREF(__pyx_tuple__207);

  /* "(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__208 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__208)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__208);
  __Pyx_GIVEREF(__pyx_tuple__208);

  /* "(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__209 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__209)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__209);
  __Pyx_GIVEREF(__pyx_tuple__209);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__210 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__210)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__210);
  __Pyx_GIVEREF(__pyx_tuple__210);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__211 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__211)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__211);
  __Pyx_GIVEREF(__pyx_tuple__211);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__212 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__212)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__212);
  __Pyx_GIVEREF(__pyx_tuple__212);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__213 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__213)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__213);
  __Pyx_GIVEREF(__pyx_tuple__213);

  /* "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__214 = PyTuple_Pack(1, __pyx_kp_u_prior_column_had_a_different_num); if (unlikely(!__pyx_tuple__214)) __PYX_ERR(13, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__214);
  __Pyx_GIVEREF(__pyx_tuple__214);

  /* "(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__215 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__215)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__215);
  __Pyx_GIVEREF(__pyx_tuple__215);

  /* "(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__216 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__216)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__216);
  __Pyx_GIVEREF(__pyx_tuple__216);

  /* "(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__217 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__217)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__217);
  __Pyx_GIVEREF(__pyx_tuple__217);

  /* "(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__218 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__218)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__218);
  __Pyx_GIVEREF(__pyx_tuple__218);

  /* "(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__219 = PyTuple_Pack(1, __pyx_kp_s_self_data_cannot_be_converted_to); if (unlikely(!__pyx_tuple__219)) __PYX_ERR(9, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__219);
  __Pyx_GIVEREF(__pyx_tuple__219);

  /* "(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__220 = PyTuple_Pack(1, __pyx_kp_s_self_data_cannot_be_converted_to); if (unlikely(!__pyx_tuple__220)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__220);
  __Pyx_GIVEREF(__pyx_tuple__220);

  /* "pyarrow/public-api.pxi":175
 * cdef api object pyarrow_wrap_array(const shared_ptr[CArray]& sp_array):
 *     if sp_array.get() == NULL:
 *         raise ValueError('Array was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef CDataType* data_type = sp_array.get().type().get()
 */
  __pyx_tuple__221 = PyTuple_Pack(1, __pyx_kp_u_Array_was_NULL); if (unlikely(!__pyx_tuple__221)) __PYX_ERR(16, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__221);
  __Pyx_GIVEREF(__pyx_tuple__221);

  /* "pyarrow/public-api.pxi":180
 * 
 *     if data_type == NULL:
 *         raise ValueError('Array data type was NULL')             # <<<<<<<<<<<<<<
 * 
 *     klass = _array_classes[data_type.id()]
 */
  __pyx_tuple__222 = PyTuple_Pack(1, __pyx_kp_u_Array_data_type_was_NULL); if (unlikely(!__pyx_tuple__222)) __PYX_ERR(16, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__222);
  __Pyx_GIVEREF(__pyx_tuple__222);

  /* "pyarrow/public-api.pxi":192
 *         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__223 = PyTuple_Pack(1, __pyx_kp_u_ChunkedArray_was_NULL); if (unlikely(!__pyx_tuple__223)) __PYX_ERR(16, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__223);
  __Pyx_GIVEREF(__pyx_tuple__223);

  /* "pyarrow/public-api.pxi":197
 * 
 *     if data_type == NULL:
 *         raise ValueError('ChunkedArray data type was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef ChunkedArray arr = ChunkedArray.__new__(ChunkedArray)
 */
  __pyx_tuple__224 = PyTuple_Pack(1, __pyx_kp_u_ChunkedArray_data_type_was_NULL); if (unlikely(!__pyx_tuple__224)) __PYX_ERR(16, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__224);
  __Pyx_GIVEREF(__pyx_tuple__224);

  /* "pyarrow/public-api.pxi":205
 * cdef api object pyarrow_wrap_scalar(const shared_ptr[CScalar]& sp_scalar):
 *     if sp_scalar.get() == NULL:
 *         raise ValueError('Scalar was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef CDataType* data_type = sp_scalar.get().type.get()
 */
  __pyx_tuple__225 = PyTuple_Pack(1, __pyx_kp_u_Scalar_was_NULL); if (unlikely(!__pyx_tuple__225)) __PYX_ERR(16, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__225);
  __Pyx_GIVEREF(__pyx_tuple__225);

  /* "pyarrow/public-api.pxi":210
 * 
 *     if data_type == NULL:
 *         raise ValueError('Scalar data type was NULL')             # <<<<<<<<<<<<<<
 * 
 *     klass = _scalar_classes[data_type.id()]
 */
  __pyx_tuple__226 = PyTuple_Pack(1, __pyx_kp_u_Scalar_data_type_was_NULL); if (unlikely(!__pyx_tuple__226)) __PYX_ERR(16, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__226);
  __Pyx_GIVEREF(__pyx_tuple__226);

  /* "pyarrow/public-api.pxi":234
 *         const shared_ptr[CTensor]& sp_tensor):
 *     if sp_tensor.get() == NULL:
 *         raise ValueError('Tensor was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef Tensor tensor = Tensor.__new__(Tensor)
 */
  __pyx_tuple__227 = PyTuple_Pack(1, __pyx_kp_u_Tensor_was_NULL); if (unlikely(!__pyx_tuple__227)) __PYX_ERR(16, 234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__227);
  __Pyx_GIVEREF(__pyx_tuple__227);

  /* "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__228 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at); if (unlikely(!__pyx_tuple__228)) __PYX_ERR(9, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__228);
  __Pyx_GIVEREF(__pyx_tuple__228);

  /* "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__229 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_2); if (unlikely(!__pyx_tuple__229)) __PYX_ERR(9, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__229);
  __Pyx_GIVEREF(__pyx_tuple__229);

  /* "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__230 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_3); if (unlikely(!__pyx_tuple__230)) __PYX_ERR(9, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__230);
  __Pyx_GIVEREF(__pyx_tuple__230);

  /* "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__231 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_4); if (unlikely(!__pyx_tuple__231)) __PYX_ERR(9, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__231);
  __Pyx_GIVEREF(__pyx_tuple__231);

  /* "FromPyStructUtility":39
 *         value = obj['use_threads']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'use_threads'")             # <<<<<<<<<<<<<<
 *     result.use_threads = value
 *     try:
 */
  __pyx_tuple__232 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_5); if (unlikely(!__pyx_tuple__232)) __PYX_ERR(9, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__232);
  __Pyx_GIVEREF(__pyx_tuple__232);

  /* "FromPyStructUtility":44
 *         value = obj['deduplicate_objects']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'deduplicate_objects'")             # <<<<<<<<<<<<<<
 *     result.deduplicate_objects = value
 *     return result
 */
  __pyx_tuple__233 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_6); if (unlikely(!__pyx_tuple__233)) __PYX_ERR(9, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__233);
  __Pyx_GIVEREF(__pyx_tuple__233);

  /* "pyarrow/lib.pyx":42
 * 
 * 
 * def cpu_count():             # <<<<<<<<<<<<<<
 *     """
 *     Return the number of threads to use in parallel operations.
 */
  __pyx_codeobj__234 = (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, 42, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__234)) __PYX_ERR(8, 42, __pyx_L1_error)

  /* "pyarrow/lib.pyx":55
 * 
 * 
 * def set_cpu_count(int count):             # <<<<<<<<<<<<<<
 *     """
 *     Set the number of threads to use in parallel operations.
 */
  __pyx_tuple__235 = PyTuple_Pack(2, __pyx_n_s_count, __pyx_n_s_count); if (unlikely(!__pyx_tuple__235)) __PYX_ERR(8, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__235);
  __Pyx_GIVEREF(__pyx_tuple__235);
  __pyx_codeobj__236 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__235, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_lib_pyx, __pyx_n_s_set_cpu_count, 55, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__236)) __PYX_ERR(8, 55, __pyx_L1_error)

  /* "pyarrow/memory.pxi":90
 * 
 * 
 * def default_memory_pool():             # <<<<<<<<<<<<<<
 *     """
 *     Return the process-global memory pool.
 */
  __pyx_tuple__237 = PyTuple_Pack(1, __pyx_n_s_pool); if (unlikely(!__pyx_tuple__237)) __PYX_ERR(10, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__237);
  __Pyx_GIVEREF(__pyx_tuple__237);
  __pyx_codeobj__238 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__237, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_memory_pxi, __pyx_n_s_default_memory_pool, 90, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__238)) __PYX_ERR(10, 90, __pyx_L1_error)

  /* "pyarrow/memory.pxi":100
 * 
 * 
 * def proxy_memory_pool(MemoryPool parent):             # <<<<<<<<<<<<<<
 *     """
 *     Create and return a MemoryPool instance that redirects to the
 */
  __pyx_tuple__239 = PyTuple_Pack(2, __pyx_n_s_parent, __pyx_n_s_out); if (unlikely(!__pyx_tuple__239)) __PYX_ERR(10, 100, __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_memory_pxi, __pyx_n_s_proxy_memory_pool, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__240)) __PYX_ERR(10, 100, __pyx_L1_error)

  /* "pyarrow/memory.pxi":111
 * 
 * 
 * def logging_memory_pool(MemoryPool parent):             # <<<<<<<<<<<<<<
 *     """
 *     Create and return a MemoryPool instance that redirects to the
 */
  __pyx_tuple__241 = PyTuple_Pack(2, __pyx_n_s_parent, __pyx_n_s_out); if (unlikely(!__pyx_tuple__241)) __PYX_ERR(10, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__241);
  __Pyx_GIVEREF(__pyx_tuple__241);
  __pyx_codeobj__242 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 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_memory_pxi, __pyx_n_s_logging_memory_pool, 111, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__242)) __PYX_ERR(10, 111, __pyx_L1_error)

  /* "pyarrow/memory.pxi":123
 * 
 * 
 * def set_memory_pool(MemoryPool pool):             # <<<<<<<<<<<<<<
 *     c_set_default_memory_pool(pool.pool)
 * 
 */
  __pyx_tuple__243 = PyTuple_Pack(1, __pyx_n_s_pool); if (unlikely(!__pyx_tuple__243)) __PYX_ERR(10, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__243);
  __Pyx_GIVEREF(__pyx_tuple__243);
  __pyx_codeobj__244 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 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_memory_pxi, __pyx_n_s_set_memory_pool, 123, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__244)) __PYX_ERR(10, 123, __pyx_L1_error)

  /* "pyarrow/memory.pxi":132
 * 
 * 
 * def log_memory_allocations(enable=True):             # <<<<<<<<<<<<<<
 *     """
 *     Enable or disable memory allocator logging for debugging purposes
 */
  __pyx_tuple__245 = PyTuple_Pack(1, __pyx_n_s_enable); if (unlikely(!__pyx_tuple__245)) __PYX_ERR(10, 132, __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_memory_pxi, __pyx_n_s_log_memory_allocations, 132, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__246)) __PYX_ERR(10, 132, __pyx_L1_error)

  /* "pyarrow/memory.pxi":147
 * 
 * 
 * def total_allocated_bytes():             # <<<<<<<<<<<<<<
 *     """
 *     Return the currently allocated bytes from the default memory pool.
 */
  __pyx_tuple__247 = PyTuple_Pack(1, __pyx_n_s_pool); if (unlikely(!__pyx_tuple__247)) __PYX_ERR(10, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__247);
  __Pyx_GIVEREF(__pyx_tuple__247);
  __pyx_codeobj__248 = (PyObject*)__Pyx_PyCode_New(0, 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_memory_pxi, __pyx_n_s_total_allocated_bytes, 147, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__248)) __PYX_ERR(10, 147, __pyx_L1_error)

  /* "pyarrow/types.pxi":38
 *     _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__249 = PyTuple_Pack(1, __pyx_kp_u_datetime64_ns); if (unlikely(!__pyx_tuple__249)) __PYX_ERR(4, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__249);
  __Pyx_GIVEREF(__pyx_tuple__249);

  /* "pyarrow/types.pxi":80
 * 
 * 
 * def _is_primitive(Type type):             # <<<<<<<<<<<<<<
 *     # This is simply a redirect, the official API is in pyarrow.types.
 *     return is_primitive(type)
 */
  __pyx_tuple__250 = PyTuple_Pack(2, __pyx_n_s_type, __pyx_n_s_type); if (unlikely(!__pyx_tuple__250)) __PYX_ERR(4, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__250);
  __Pyx_GIVEREF(__pyx_tuple__250);
  __pyx_codeobj__251 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__250, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_is_primitive, 80, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__251)) __PYX_ERR(4, 80, __pyx_L1_error)

  /* "pyarrow/types.pxi":972
 * 
 * 
 * def field(name, type, bint nullable=True, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create a pyarrow.Field instance
 */
  __pyx_tuple__252 = PyTuple_Pack(7, __pyx_n_s_name_2, __pyx_n_s_type, __pyx_n_s_nullable, __pyx_n_s_metadata, __pyx_n_s_result, __pyx_n_s_type_4, __pyx_n_s_c_meta); if (unlikely(!__pyx_tuple__252)) __PYX_ERR(4, 972, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__252);
  __Pyx_GIVEREF(__pyx_tuple__252);
  __pyx_codeobj__253 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__252, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_field, 972, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__253)) __PYX_ERR(4, 972, __pyx_L1_error)

  /* "pyarrow/types.pxi":1021
 * 
 * 
 * def null():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of null type
 */
  __pyx_codeobj__254 = (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, 1021, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__254)) __PYX_ERR(4, 1021, __pyx_L1_error)

  /* "pyarrow/types.pxi":1028
 * 
 * 
 * def bool_():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of boolean type
 */
  __pyx_codeobj__255 = (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, 1028, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__255)) __PYX_ERR(4, 1028, __pyx_L1_error)

  /* "pyarrow/types.pxi":1035
 * 
 * 
 * def uint8():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned int8 type
 */
  __pyx_codeobj__256 = (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, 1035, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__256)) __PYX_ERR(4, 1035, __pyx_L1_error)

  /* "pyarrow/types.pxi":1042
 * 
 * 
 * def int8():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int8 type
 */
  __pyx_codeobj__257 = (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, 1042, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__257)) __PYX_ERR(4, 1042, __pyx_L1_error)

  /* "pyarrow/types.pxi":1049
 * 
 * 
 * def uint16():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint16 type
 */
  __pyx_codeobj__258 = (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, 1049, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__258)) __PYX_ERR(4, 1049, __pyx_L1_error)

  /* "pyarrow/types.pxi":1056
 * 
 * 
 * def int16():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int16 type
 */
  __pyx_codeobj__259 = (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, 1056, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__259)) __PYX_ERR(4, 1056, __pyx_L1_error)

  /* "pyarrow/types.pxi":1063
 * 
 * 
 * def uint32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint32 type
 */
  __pyx_codeobj__260 = (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, 1063, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__260)) __PYX_ERR(4, 1063, __pyx_L1_error)

  /* "pyarrow/types.pxi":1070
 * 
 * 
 * def int32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int32 type
 */
  __pyx_codeobj__261 = (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, 1070, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__261)) __PYX_ERR(4, 1070, __pyx_L1_error)

  /* "pyarrow/types.pxi":1077
 * 
 * 
 * def uint64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint64 type
 */
  __pyx_codeobj__262 = (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, 1077, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__262)) __PYX_ERR(4, 1077, __pyx_L1_error)

  /* "pyarrow/types.pxi":1084
 * 
 * 
 * def int64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int64 type
 */
  __pyx_codeobj__263 = (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, 1084, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__263)) __PYX_ERR(4, 1084, __pyx_L1_error)

  /* "pyarrow/types.pxi":1106
 * 
 * 
 * _FIXED_OFFSET_RE = re.compile(r'([+-])(0[0-9]|1[0-9]|2[0-3]):([0-5][0-9])$')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__264 = PyTuple_Pack(1, __pyx_kp_u_0_0_9_1_0_9_2_0_3_0_5_0_9); if (unlikely(!__pyx_tuple__264)) __PYX_ERR(4, 1106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__264);
  __Pyx_GIVEREF(__pyx_tuple__264);

  /* "pyarrow/types.pxi":1109
 * 
 * 
 * def tzinfo_to_string(tz):             # <<<<<<<<<<<<<<
 *     """
 *     Converts a time zone object into a string indicating the name of a time
 */
  __pyx_tuple__265 = PyTuple_Pack(5, __pyx_n_s_tz, __pyx_n_s_pytz, __pyx_n_s_datetime, __pyx_n_s_fixed_offset_to_string, __pyx_n_s_fixed_offset_to_string); if (unlikely(!__pyx_tuple__265)) __PYX_ERR(4, 1109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__265);
  __Pyx_GIVEREF(__pyx_tuple__265);
  __pyx_codeobj__266 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 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_types_pxi, __pyx_n_s_tzinfo_to_string, 1109, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__266)) __PYX_ERR(4, 1109, __pyx_L1_error)

  /* "pyarrow/types.pxi":1155
 * 
 * 
 * def string_to_tzinfo(name):             # <<<<<<<<<<<<<<
 *     """
 *     Converts a string indicating the name of a time zone into a time zone
 */
  __pyx_tuple__267 = 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); if (unlikely(!__pyx_tuple__267)) __PYX_ERR(4, 1155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__267);
  __Pyx_GIVEREF(__pyx_tuple__267);
  __pyx_codeobj__268 = (PyObject*)__Pyx_PyCode_New(1, 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_types_pxi, __pyx_n_s_string_to_tzinfo, 1155, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__268)) __PYX_ERR(4, 1155, __pyx_L1_error)

  /* "pyarrow/types.pxi":1183
 * 
 * 
 * def timestamp(unit, tz=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of timestamp type with resolution and optional time zone
 */
  __pyx_tuple__269 = 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__269)) __PYX_ERR(4, 1183, __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_types_pxi, __pyx_n_s_timestamp, 1183, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__270)) __PYX_ERR(4, 1183, __pyx_L1_error)

  /* "pyarrow/types.pxi":1238
 * 
 * 
 * def time32(unit):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 32-bit time (time of day) type with unit resolution
 */
  __pyx_tuple__271 = 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__271)) __PYX_ERR(4, 1238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__271);
  __Pyx_GIVEREF(__pyx_tuple__271);
  __pyx_codeobj__272 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 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_types_pxi, __pyx_n_s_time32, 1238, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__272)) __PYX_ERR(4, 1238, __pyx_L1_error)

  /* "pyarrow/types.pxi":1276
 * 
 * 
 * def time64(unit):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 64-bit time (time of day) type with unit resolution
 */
  __pyx_tuple__273 = 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__273)) __PYX_ERR(4, 1276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__273);
  __Pyx_GIVEREF(__pyx_tuple__273);
  __pyx_codeobj__274 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 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_types_pxi, __pyx_n_s_time64, 1276, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__274)) __PYX_ERR(4, 1276, __pyx_L1_error)

  /* "pyarrow/types.pxi":1314
 * 
 * 
 * def date32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 32-bit date (days since UNIX epoch 1970-01-01)
 */
  __pyx_codeobj__275 = (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, 1314, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__275)) __PYX_ERR(4, 1314, __pyx_L1_error)

  /* "pyarrow/types.pxi":1321
 * 
 * 
 * def date64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 64-bit date (milliseconds since UNIX epoch 1970-01-01)
 */
  __pyx_codeobj__276 = (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, 1321, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__276)) __PYX_ERR(4, 1321, __pyx_L1_error)

  /* "pyarrow/types.pxi":1328
 * 
 * 
 * def float16():             # <<<<<<<<<<<<<<
 *     """
 *     Create half-precision floating point type
 */
  __pyx_codeobj__277 = (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, 1328, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__277)) __PYX_ERR(4, 1328, __pyx_L1_error)

  /* "pyarrow/types.pxi":1335
 * 
 * 
 * def float32():             # <<<<<<<<<<<<<<
 *     """
 *     Create single-precision floating point type
 */
  __pyx_codeobj__278 = (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, 1335, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__278)) __PYX_ERR(4, 1335, __pyx_L1_error)

  /* "pyarrow/types.pxi":1342
 * 
 * 
 * def float64():             # <<<<<<<<<<<<<<
 *     """
 *     Create double-precision floating point type
 */
  __pyx_codeobj__279 = (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, 1342, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__279)) __PYX_ERR(4, 1342, __pyx_L1_error)

  /* "pyarrow/types.pxi":1369
 * 
 * 
 * def string():             # <<<<<<<<<<<<<<
 *     """
 *     Create UTF8 variable-length string type
 */
  __pyx_codeobj__280 = (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, 1369, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__280)) __PYX_ERR(4, 1369, __pyx_L1_error)

  /* "pyarrow/types.pxi":1376
 * 
 * 
 * def utf8():             # <<<<<<<<<<<<<<
 *     """
 *     Alias for string()
 */
  __pyx_codeobj__281 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_utf8, 1376, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__281)) __PYX_ERR(4, 1376, __pyx_L1_error)

  /* "pyarrow/types.pxi":1383
 * 
 * 
 * def binary(int length=-1):             # <<<<<<<<<<<<<<
 *     """
 *     Create variable-length binary type
 */
  __pyx_tuple__282 = PyTuple_Pack(2, __pyx_n_s_length, __pyx_n_s_fixed_size_binary_type); if (unlikely(!__pyx_tuple__282)) __PYX_ERR(4, 1383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__282);
  __Pyx_GIVEREF(__pyx_tuple__282);
  __pyx_codeobj__283 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__282, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_binary, 1383, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__283)) __PYX_ERR(4, 1383, __pyx_L1_error)

  /* "pyarrow/types.pxi":1455
 * 
 * 
 * def struct(fields):             # <<<<<<<<<<<<<<
 *     """
 *     Create StructType instance from fields
 */
  __pyx_tuple__284 = 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__284)) __PYX_ERR(4, 1455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__284);
  __Pyx_GIVEREF(__pyx_tuple__284);
  __pyx_codeobj__285 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__284, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_struct, 1455, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__285)) __PYX_ERR(4, 1455, __pyx_L1_error)

  /* "pyarrow/types.pxi":1503
 * 
 * 
 * def union(children_fields, mode):             # <<<<<<<<<<<<<<
 *     """
 *     Create UnionType from children fields.
 */
  __pyx_tuple__286 = 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__286)) __PYX_ERR(4, 1503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__286);
  __Pyx_GIVEREF(__pyx_tuple__286);
  __pyx_codeobj__287 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__286, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_union, 1503, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__287)) __PYX_ERR(4, 1503, __pyx_L1_error)

  /* "pyarrow/types.pxi":1586
 *     'date32[day]': date32,
 *     'date64[ms]': date64,
 *     'time32[s]': time32('s'),             # <<<<<<<<<<<<<<
 *     'time32[ms]': time32('ms'),
 *     'time64[us]': time64('us'),
 */
  __pyx_tuple__288 = PyTuple_Pack(1, __pyx_n_u_s); if (unlikely(!__pyx_tuple__288)) __PYX_ERR(4, 1586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__288);
  __Pyx_GIVEREF(__pyx_tuple__288);

  /* "pyarrow/types.pxi":1587
 *     'date64[ms]': date64,
 *     'time32[s]': time32('s'),
 *     'time32[ms]': time32('ms'),             # <<<<<<<<<<<<<<
 *     'time64[us]': time64('us'),
 *     'time64[ns]': time64('ns'),
 */
  __pyx_tuple__289 = PyTuple_Pack(1, __pyx_n_u_ms); if (unlikely(!__pyx_tuple__289)) __PYX_ERR(4, 1587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__289);
  __Pyx_GIVEREF(__pyx_tuple__289);

  /* "pyarrow/types.pxi":1588
 *     'time32[s]': time32('s'),
 *     'time32[ms]': time32('ms'),
 *     'time64[us]': time64('us'),             # <<<<<<<<<<<<<<
 *     'time64[ns]': time64('ns'),
 *     'timestamp[s]': timestamp('s'),
 */
  __pyx_tuple__290 = PyTuple_Pack(1, __pyx_n_u_us); if (unlikely(!__pyx_tuple__290)) __PYX_ERR(4, 1588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__290);
  __Pyx_GIVEREF(__pyx_tuple__290);

  /* "pyarrow/types.pxi":1589
 *     'time32[ms]': time32('ms'),
 *     'time64[us]': time64('us'),
 *     'time64[ns]': time64('ns'),             # <<<<<<<<<<<<<<
 *     'timestamp[s]': timestamp('s'),
 *     'timestamp[ms]': timestamp('ms'),
 */
  __pyx_tuple__291 = PyTuple_Pack(1, __pyx_n_u_ns); if (unlikely(!__pyx_tuple__291)) __PYX_ERR(4, 1589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__291);
  __Pyx_GIVEREF(__pyx_tuple__291);

  /* "pyarrow/types.pxi":1597
 * 
 * 
 * def type_for_alias(name):             # <<<<<<<<<<<<<<
 *     """
 *     Return DataType given a string alias if one exists
 */
  __pyx_tuple__292 = PyTuple_Pack(2, __pyx_n_s_name_2, __pyx_n_s_alias); if (unlikely(!__pyx_tuple__292)) __PYX_ERR(4, 1597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__292);
  __Pyx_GIVEREF(__pyx_tuple__292);
  __pyx_codeobj__293 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__292, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_type_for_alias, 1597, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__293)) __PYX_ERR(4, 1597, __pyx_L1_error)

  /* "pyarrow/types.pxi":1627
 * 
 * 
 * def schema(fields, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct pyarrow.Schema from collection of fields
 */
  __pyx_tuple__294 = 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__294)) __PYX_ERR(4, 1627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__294);
  __Pyx_GIVEREF(__pyx_tuple__294);
  __pyx_codeobj__295 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__294, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_schema, 1627, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__295)) __PYX_ERR(4, 1627, __pyx_L1_error)

  /* "pyarrow/types.pxi":1683
 * 
 * 
 * def from_numpy_dtype(object dtype):             # <<<<<<<<<<<<<<
 *     """
 *     Convert NumPy dtype to pyarrow.DataType
 */
  __pyx_tuple__296 = PyTuple_Pack(2, __pyx_n_s_dtype, __pyx_n_s_c_type); if (unlikely(!__pyx_tuple__296)) __PYX_ERR(4, 1683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__296);
  __Pyx_GIVEREF(__pyx_tuple__296);
  __pyx_codeobj__297 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__296, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_from_numpy_dtype, 1683, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__297)) __PYX_ERR(4, 1683, __pyx_L1_error)

  /* "pyarrow/types.pxi":1695
 * 
 * 
 * def is_boolean_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyBool(obj)
 * 
 */
  __pyx_tuple__298 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__298)) __PYX_ERR(4, 1695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__298);
  __Pyx_GIVEREF(__pyx_tuple__298);
  __pyx_codeobj__299 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__298, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_is_boolean_value, 1695, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__299)) __PYX_ERR(4, 1695, __pyx_L1_error)

  /* "pyarrow/types.pxi":1699
 * 
 * 
 * def is_integer_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyInt(obj)
 * 
 */
  __pyx_tuple__300 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__300)) __PYX_ERR(4, 1699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__300);
  __Pyx_GIVEREF(__pyx_tuple__300);
  __pyx_codeobj__301 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__300, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_is_integer_value, 1699, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__301)) __PYX_ERR(4, 1699, __pyx_L1_error)

  /* "pyarrow/types.pxi":1703
 * 
 * 
 * def is_float_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyFloat(obj)
 */
  __pyx_tuple__302 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__302)) __PYX_ERR(4, 1703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__302);
  __Pyx_GIVEREF(__pyx_tuple__302);
  __pyx_codeobj__303 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__302, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_is_float_value, 1703, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__303)) __PYX_ERR(4, 1703, __pyx_L1_error)

  /* "pyarrow/array.pxi":50
 * 
 * 
 * def _ndarray_to_arrow_type(object values, DataType type):             # <<<<<<<<<<<<<<
 *     return pyarrow_wrap_data_type(_ndarray_to_type(values, type))
 * 
 */
  __pyx_tuple__304 = PyTuple_Pack(2, __pyx_n_s_values, __pyx_n_s_type); if (unlikely(!__pyx_tuple__304)) __PYX_ERR(1, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__304);
  __Pyx_GIVEREF(__pyx_tuple__304);
  __pyx_codeobj__305 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__304, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_ndarray_to_arrow_type, 50, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__305)) __PYX_ERR(1, 50, __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__306 = PyTuple_Pack(9, __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); if (unlikely(!__pyx_tuple__306)) __PYX_ERR(1, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__306);
  __Pyx_GIVEREF(__pyx_tuple__306);
  __pyx_codeobj__307 = (PyObject*)__Pyx_PyCode_New(7, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__306, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_array, 87, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__307)) __PYX_ERR(1, 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__308 = PyTuple_Pack(2, __pyx_n_s_values, __pyx_n_s_type); if (unlikely(!__pyx_tuple__308)) __PYX_ERR(1, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__308);
  __Pyx_GIVEREF(__pyx_tuple__308);
  __pyx_codeobj__309 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__308, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_asarray, 176, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__309)) __PYX_ERR(1, 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__310 = 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__310)) __PYX_ERR(1, 199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__310);
  __Pyx_GIVEREF(__pyx_tuple__310);
  __pyx_codeobj__311 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__310, __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__311)) __PYX_ERR(1, 199, __pyx_L1_error)

  /* "pyarrow/array.pxi":334
 * 
 * 
 * def _restore_array(data):             # <<<<<<<<<<<<<<
 *     """
 *     Reconstruct an Array from pickled ArrayData.
 */
  __pyx_tuple__312 = PyTuple_Pack(2, __pyx_n_s_data, __pyx_n_s_ad); if (unlikely(!__pyx_tuple__312)) __PYX_ERR(1, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__312);
  __Pyx_GIVEREF(__pyx_tuple__312);
  __pyx_codeobj__313 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__312, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_restore_array, 334, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__313)) __PYX_ERR(1, 334, __pyx_L1_error)

  /* "pyarrow/array.pxi":510
 * 
 *     @staticmethod
 *     def from_pandas(obj, mask=None, type=None, bint safe=True,             # <<<<<<<<<<<<<<
 *                     MemoryPool memory_pool=None):
 *         """
 */
  __pyx_tuple__314 = 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__314)) __PYX_ERR(1, 510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__314);
  __Pyx_GIVEREF(__pyx_tuple__314);
  __pyx_codeobj__315 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__314, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_from_pandas, 510, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__315)) __PYX_ERR(1, 510, __pyx_L1_error)

  /* "pyarrow/array.pxi":550
 * 
 *     @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__316 = 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__316)) __PYX_ERR(1, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__316);
  __Pyx_GIVEREF(__pyx_tuple__316);
  __pyx_codeobj__317 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__316, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_from_buffers, 550, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__317)) __PYX_ERR(1, 550, __pyx_L1_error)

  /* "pyarrow/array.pxi":780
 * 
 *     @staticmethod
 *     def from_numpy(obj):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CTensor] ctensor
 *         with nogil:
 */
  __pyx_tuple__318 = PyTuple_Pack(2, __pyx_n_s_obj, __pyx_n_s_ctensor); if (unlikely(!__pyx_tuple__318)) __PYX_ERR(1, 780, __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_array_pxi, __pyx_n_s_from_numpy, 780, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__319)) __PYX_ERR(1, 780, __pyx_L1_error)

  /* "pyarrow/array.pxi":1013
 * 
 *     @staticmethod
 *     def from_arrays(offsets, values, MemoryPool pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct ListArray from arrays of int32 offsets and values
 */
  __pyx_tuple__320 = 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__320)) __PYX_ERR(1, 1013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__320);
  __Pyx_GIVEREF(__pyx_tuple__320);
  __pyx_codeobj__321 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 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_array_pxi, __pyx_n_s_from_arrays, 1013, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__321)) __PYX_ERR(1, 1013, __pyx_L1_error)

  /* "pyarrow/array.pxi":1057
 * 
 *     @staticmethod
 *     def from_dense(Array types, Array value_offsets, list children):             # <<<<<<<<<<<<<<
 *         """
 *         Construct dense UnionArray from arrays of int8 types, int32 offsets and
 */
  __pyx_tuple__322 = 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__322)) __PYX_ERR(1, 1057, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__322);
  __Pyx_GIVEREF(__pyx_tuple__322);
  __pyx_codeobj__323 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 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_array_pxi, __pyx_n_s_from_dense, 1057, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__323)) __PYX_ERR(1, 1057, __pyx_L1_error)

  /* "pyarrow/array.pxi":1083
 * 
 *     @staticmethod
 *     def from_sparse(Array types, list children):             # <<<<<<<<<<<<<<
 *         """
 *         Construct sparse UnionArray from arrays of int8 types and children
 */
  __pyx_tuple__324 = 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__324)) __PYX_ERR(1, 1083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__324);
  __Pyx_GIVEREF(__pyx_tuple__324);
  __pyx_codeobj__325 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 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_array_pxi, __pyx_n_s_from_sparse, 1083, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__325)) __PYX_ERR(1, 1083, __pyx_L1_error)

  /* "pyarrow/array.pxi":1113
 * 
 *     @staticmethod
 *     def from_buffers(int length, Buffer value_offsets, Buffer data,             # <<<<<<<<<<<<<<
 *                      Buffer null_bitmap=None, int null_count=-1,
 *                      int offset=0):
 */
  __pyx_tuple__326 = 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__326)) __PYX_ERR(1, 1113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__326);
  __Pyx_GIVEREF(__pyx_tuple__326);
  __pyx_codeobj__327 = (PyObject*)__Pyx_PyCode_New(6, 0, 8, 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_array_pxi, __pyx_n_s_from_buffers, 1113, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__327)) __PYX_ERR(1, 1113, __pyx_L1_error)

  /* "pyarrow/array.pxi":1181
 * 
 *     @staticmethod
 *     def from_arrays(indices, dictionary, mask=None, bint ordered=False,             # <<<<<<<<<<<<<<
 *                     bint from_pandas=False, bint safe=True,
 *                     MemoryPool memory_pool=None):
 */
  __pyx_tuple__328 = 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__328)) __PYX_ERR(1, 1181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__328);
  __Pyx_GIVEREF(__pyx_tuple__328);
  __pyx_codeobj__329 = (PyObject*)__Pyx_PyCode_New(7, 0, 12, 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_array_pxi, __pyx_n_s_from_arrays, 1181, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__329)) __PYX_ERR(1, 1181, __pyx_L1_error)

  /* "pyarrow/array.pxi":1309
 * 
 *     @staticmethod
 *     def from_arrays(arrays, names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct StructArray from collection of arrays representing each field
 */
  __pyx_tuple__330 = PyTuple_Pack(13, __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, __pyx_n_s_array); if (unlikely(!__pyx_tuple__330)) __PYX_ERR(1, 1309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__330);
  __Pyx_GIVEREF(__pyx_tuple__330);
  __pyx_codeobj__331 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 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_array_pxi, __pyx_n_s_from_arrays, 1309, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__331)) __PYX_ERR(1, 1309, __pyx_L1_error)

  /* "pyarrow/table.pxi":264
 * 
 * 
 * def chunked_array(arrays, type=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct chunked array from list of array-like objects
 */
  __pyx_tuple__332 = 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__332)) __PYX_ERR(12, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__332);
  __Pyx_GIVEREF(__pyx_tuple__332);
  __pyx_codeobj__333 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 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_table_pxi, __pyx_n_s_chunked_array, 264, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__333)) __PYX_ERR(12, 264, __pyx_L1_error)

  /* "pyarrow/table.pxi":304
 * 
 * 
 * def column(object field_or_name, arr):             # <<<<<<<<<<<<<<
 *     """
 *     Create Column object from field/string and array-like data
 */
  __pyx_tuple__334 = 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__334)) __PYX_ERR(12, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__334);
  __Pyx_GIVEREF(__pyx_tuple__334);
  __pyx_codeobj__335 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 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_table_pxi, __pyx_n_s_column, 304, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__335)) __PYX_ERR(12, 304, __pyx_L1_error)

  /* "pyarrow/table.pxi":385
 * 
 *     @staticmethod
 *     def from_array(*args):             # <<<<<<<<<<<<<<
 *         return column(*args)
 * 
 */
  __pyx_tuple__336 = PyTuple_Pack(1, __pyx_n_s_args); if (unlikely(!__pyx_tuple__336)) __PYX_ERR(12, 385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__336);
  __Pyx_GIVEREF(__pyx_tuple__336);
  __pyx_codeobj__337 = (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__336, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_table_pxi, __pyx_n_s_from_array, 385, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__337)) __PYX_ERR(12, 385, __pyx_L1_error)

  /* "pyarrow/table.pxi":864
 * 
 *     @staticmethod
 *     def from_arrays(list arrays, names, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a RecordBatch from multiple pyarrow.Arrays
 */
  __pyx_tuple__338 = 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__338)) __PYX_ERR(12, 864, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__338);
  __Pyx_GIVEREF(__pyx_tuple__338);
  __pyx_codeobj__339 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 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_table_pxi, __pyx_n_s_from_arrays, 864, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__339)) __PYX_ERR(12, 864, __pyx_L1_error)

  /* "pyarrow/table.pxi":908
 * 
 * 
 * def _reconstruct_record_batch(columns, schema):             # <<<<<<<<<<<<<<
 *     """
 *     Internal: reconstruct RecordBatch from pickled components.
 */
  __pyx_tuple__340 = PyTuple_Pack(2, __pyx_n_s_columns, __pyx_n_s_schema); if (unlikely(!__pyx_tuple__340)) __PYX_ERR(12, 908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__340);
  __Pyx_GIVEREF(__pyx_tuple__340);
  __pyx_codeobj__341 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 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_table_pxi, __pyx_n_s_reconstruct_record_batch, 908, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__341)) __PYX_ERR(12, 908, __pyx_L1_error)

  /* "pyarrow/table.pxi":915
 * 
 * 
 * def table_to_blocks(PandasOptions options, Table table,             # <<<<<<<<<<<<<<
 *                     MemoryPool memory_pool, categories):
 *     cdef:
 */
  __pyx_tuple__342 = 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__342)) __PYX_ERR(12, 915, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__342);
  __Pyx_GIVEREF(__pyx_tuple__342);
  __pyx_codeobj__343 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 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_table_pxi, __pyx_n_s_table_to_blocks, 915, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__343)) __PYX_ERR(12, 915, __pyx_L1_error)

  /* "pyarrow/table.pxi":1150
 * 
 *     @staticmethod
 *     def from_arrays(arrays, names=None, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a Table from Arrow arrays or columns
 */
  __pyx_tuple__344 = PyTuple_Pack(9, __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_i, __pyx_n_s_K); if (unlikely(!__pyx_tuple__344)) __PYX_ERR(12, 1150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__344);
  __Pyx_GIVEREF(__pyx_tuple__344);
  __pyx_codeobj__345 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 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_table_pxi, __pyx_n_s_from_arrays, 1150, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__345)) __PYX_ERR(12, 1150, __pyx_L1_error)

  /* "pyarrow/table.pxi":1218
 * 
 *     @staticmethod
 *     def from_batches(batches, Schema schema=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a Table from a sequence or iterator of Arrow RecordBatches
 */
  __pyx_tuple__346 = 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__346)) __PYX_ERR(12, 1218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__346);
  __Pyx_GIVEREF(__pyx_tuple__346);
  __pyx_codeobj__347 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 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_table_pxi, __pyx_n_s_from_batches, 1218, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__347)) __PYX_ERR(12, 1218, __pyx_L1_error)

  /* "pyarrow/table.pxi":1506
 * 
 * 
 * def _reconstruct_table(arrays, schema):             # <<<<<<<<<<<<<<
 *     """
 *     Internal: reconstruct pa.Table from pickled components.
 */
  __pyx_tuple__348 = PyTuple_Pack(2, __pyx_n_s_arrays, __pyx_n_s_schema); if (unlikely(!__pyx_tuple__348)) __PYX_ERR(12, 1506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__348);
  __Pyx_GIVEREF(__pyx_tuple__348);
  __pyx_codeobj__349 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 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_table_pxi, __pyx_n_s_reconstruct_table, 1506, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__349)) __PYX_ERR(12, 1506, __pyx_L1_error)

  /* "pyarrow/table.pxi":1513
 * 
 * 
 * def concat_tables(tables):             # <<<<<<<<<<<<<<
 *     """
 *     Perform zero-copy concatenation of pyarrow.Table objects. Raises exception
 */
  __pyx_tuple__350 = 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__350)) __PYX_ERR(12, 1513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__350);
  __Pyx_GIVEREF(__pyx_tuple__350);
  __pyx_codeobj__351 = (PyObject*)__Pyx_PyCode_New(1, 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_table_pxi, __pyx_n_s_concat_tables, 1513, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__351)) __PYX_ERR(12, 1513, __pyx_L1_error)

  /* "pyarrow/io.pxi":660
 * 
 *     @staticmethod
 *     def create(path, size):             # <<<<<<<<<<<<<<
 *         cdef:
 *             shared_ptr[CMemoryMappedFile] handle
 */
  __pyx_tuple__352 = 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__352)) __PYX_ERR(6, 660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__352);
  __Pyx_GIVEREF(__pyx_tuple__352);
  __pyx_codeobj__353 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 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_io_pxi, __pyx_n_s_create, 660, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__353)) __PYX_ERR(6, 660, __pyx_L1_error)

  /* "pyarrow/io.pxi":722
 * 
 * 
 * def memory_map(path, mode='r'):             # <<<<<<<<<<<<<<
 *     """
 *     Open memory map at file path. Size of the memory map cannot change
 */
  __pyx_tuple__354 = PyTuple_Pack(3, __pyx_n_s_path, __pyx_n_s_mode, __pyx_n_s_mmap); if (unlikely(!__pyx_tuple__354)) __PYX_ERR(6, 722, __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_io_pxi, __pyx_n_s_memory_map, 722, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__355)) __PYX_ERR(6, 722, __pyx_L1_error)

  /* "pyarrow/io.pxi":742
 * 
 * 
 * def create_memory_map(path, size):             # <<<<<<<<<<<<<<
 *     """
 *     Create a file of the given size and memory-map it.
 */
  __pyx_tuple__356 = PyTuple_Pack(2, __pyx_n_s_path, __pyx_n_s_size); if (unlikely(!__pyx_tuple__356)) __PYX_ERR(6, 742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__356);
  __Pyx_GIVEREF(__pyx_tuple__356);
  __pyx_codeobj__357 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__356, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_create_memory_map, 742, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__357)) __PYX_ERR(6, 742, __pyx_L1_error)

  /* "pyarrow/io.pxi":1035
 * 
 * 
 * def allocate_buffer(int64_t size, MemoryPool memory_pool=None,             # <<<<<<<<<<<<<<
 *                     resizable=False):
 *     """
 */
  __pyx_tuple__358 = 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__358)) __PYX_ERR(6, 1035, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__358);
  __Pyx_GIVEREF(__pyx_tuple__358);
  __pyx_codeobj__359 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__358, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_allocate_buffer, 1035, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__359)) __PYX_ERR(6, 1035, __pyx_L1_error)

  /* "pyarrow/io.pxi":1215
 * 
 * 
 * def py_buffer(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Construct an Arrow buffer from a Python bytes-like or buffer-like object
 */
  __pyx_tuple__360 = PyTuple_Pack(2, __pyx_n_s_obj, __pyx_n_s_buf); if (unlikely(!__pyx_tuple__360)) __PYX_ERR(6, 1215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__360);
  __Pyx_GIVEREF(__pyx_tuple__360);
  __pyx_codeobj__361 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__360, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_py_buffer, 1215, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__361)) __PYX_ERR(6, 1215, __pyx_L1_error)

  /* "pyarrow/io.pxi":1224
 * 
 * 
 * def foreign_buffer(address, size, base=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct an Arrow buffer with the given *address* and *size*,
 */
  __pyx_tuple__362 = 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__362)) __PYX_ERR(6, 1224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__362);
  __Pyx_GIVEREF(__pyx_tuple__362);
  __pyx_codeobj__363 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__362, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_foreign_buffer, 1224, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__363)) __PYX_ERR(6, 1224, __pyx_L1_error)

  /* "pyarrow/io.pxi":1243
 * 
 * 
 * def as_buffer(object o):             # <<<<<<<<<<<<<<
 *     if isinstance(o, Buffer):
 *         return o
 */
  __pyx_tuple__364 = PyTuple_Pack(1, __pyx_n_s_o); if (unlikely(!__pyx_tuple__364)) __PYX_ERR(6, 1243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__364);
  __Pyx_GIVEREF(__pyx_tuple__364);
  __pyx_codeobj__365 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__364, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_as_buffer, 1243, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__365)) __PYX_ERR(6, 1243, __pyx_L1_error)

  /* "pyarrow/io.pxi":1349
 * 
 * 
 * def _detect_compression(path):             # <<<<<<<<<<<<<<
 *     if isinstance(path, six.string_types):
 *         if path.endswith('.bz2'):
 */
  __pyx_tuple__366 = PyTuple_Pack(1, __pyx_n_s_path); if (unlikely(!__pyx_tuple__366)) __PYX_ERR(6, 1349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__366);
  __Pyx_GIVEREF(__pyx_tuple__366);
  __pyx_codeobj__367 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__366, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_detect_compression, 1349, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__367)) __PYX_ERR(6, 1349, __pyx_L1_error)

  /* "pyarrow/io.pxi":1361
 * 
 * 
 * def compress(object buf, codec='lz4', asbytes=False, memory_pool=None):             # <<<<<<<<<<<<<<
 *     """
 *     Compress data from buffer-like object.
 */
  __pyx_tuple__368 = 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__368)) __PYX_ERR(6, 1361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__368);
  __Pyx_GIVEREF(__pyx_tuple__368);
  __pyx_codeobj__369 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__368, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_compress, 1361, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__369)) __PYX_ERR(6, 1361, __pyx_L1_error)

  /* "pyarrow/io.pxi":1421
 * 
 * 
 * def decompress(object buf, decompressed_size=None, codec='lz4',             # <<<<<<<<<<<<<<
 *                asbytes=False, memory_pool=None):
 *     """
 */
  __pyx_tuple__370 = 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__370)) __PYX_ERR(6, 1421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__370);
  __Pyx_GIVEREF(__pyx_tuple__370);
  __pyx_codeobj__371 = (PyObject*)__Pyx_PyCode_New(5, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__370, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_decompress, 1421, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__371)) __PYX_ERR(6, 1421, __pyx_L1_error)

  /* "pyarrow/io.pxi":1478
 * 
 * 
 * def input_stream(source, compression='detect', buffer_size=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create an Arrow input stream.
 */
  __pyx_tuple__372 = PyTuple_Pack(5, __pyx_n_s_source, __pyx_n_s_compression, __pyx_n_s_buffer_size, __pyx_n_s_stream, __pyx_n_s_source_path); if (unlikely(!__pyx_tuple__372)) __PYX_ERR(6, 1478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__372);
  __Pyx_GIVEREF(__pyx_tuple__372);
  __pyx_codeobj__373 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__372, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_input_stream, 1478, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__373)) __PYX_ERR(6, 1478, __pyx_L1_error)

  /* "pyarrow/io.pxi":1530
 * 
 * 
 * def output_stream(source, compression='detect', buffer_size=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create an Arrow output stream.
 */
  __pyx_tuple__374 = PyTuple_Pack(5, __pyx_n_s_source, __pyx_n_s_compression, __pyx_n_s_buffer_size, __pyx_n_s_stream, __pyx_n_s_source_path); if (unlikely(!__pyx_tuple__374)) __PYX_ERR(6, 1530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__374);
  __Pyx_GIVEREF(__pyx_tuple__374);
  __pyx_codeobj__375 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__374, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_output_stream, 1530, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__375)) __PYX_ERR(6, 1530, __pyx_L1_error)

  /* "pyarrow/io-hdfs.pxi":21
 * # HDFS IO implementation
 * 
 * _HDFS_PATH_RE = re.compile(r'hdfs://(.*):(\d+)(.*)')             # <<<<<<<<<<<<<<
 * 
 * try:
 */
  __pyx_tuple__376 = PyTuple_Pack(1, __pyx_kp_u_hdfs_d); if (unlikely(!__pyx_tuple__376)) __PYX_ERR(2, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__376);
  __Pyx_GIVEREF(__pyx_tuple__376);

  /* "pyarrow/io-hdfs.pxi":30
 * 
 * 
 * def have_libhdfs():             # <<<<<<<<<<<<<<
 *     try:
 *         with nogil:
 */
  __pyx_codeobj__377 = (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__377)) __PYX_ERR(2, 30, __pyx_L1_error)

  /* "pyarrow/io-hdfs.pxi":39
 * 
 * 
 * def have_libhdfs3():             # <<<<<<<<<<<<<<
 *     try:
 *         with nogil:
 */
  __pyx_codeobj__378 = (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__378)) __PYX_ERR(2, 39, __pyx_L1_error)

  /* "pyarrow/io-hdfs.pxi":48
 * 
 * 
 * def strip_hdfs_abspath(path):             # <<<<<<<<<<<<<<
 *     m = _HDFS_PATH_RE.match(path)
 *     if m:
 */
  __pyx_tuple__379 = PyTuple_Pack(2, __pyx_n_s_path, __pyx_n_s_m); if (unlikely(!__pyx_tuple__379)) __PYX_ERR(2, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__379);
  __Pyx_GIVEREF(__pyx_tuple__379);
  __pyx_codeobj__380 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__379, __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__380)) __PYX_ERR(2, 48, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":118
 * 
 *     @staticmethod
 *     def open_stream(source):             # <<<<<<<<<<<<<<
 *         cdef MessageReader result = MessageReader.__new__(MessageReader)
 *         cdef shared_ptr[InputStream] in_stream
 */
  __pyx_tuple__381 = PyTuple_Pack(4, __pyx_n_s_source, __pyx_n_s_result, __pyx_n_s_in_stream, __pyx_n_s_reader); if (unlikely(!__pyx_tuple__381)) __PYX_ERR(7, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__381);
  __Pyx_GIVEREF(__pyx_tuple__381);
  __pyx_codeobj__382 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__381, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_ipc_pxi, __pyx_n_s_open_stream, 118, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__382)) __PYX_ERR(7, 118, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":403
 * 
 * 
 * def get_tensor_size(Tensor tensor):             # <<<<<<<<<<<<<<
 *     """
 *     Return total size of serialized Tensor including metadata and padding
 */
  __pyx_tuple__383 = PyTuple_Pack(2, __pyx_n_s_tensor, __pyx_n_s_size); if (unlikely(!__pyx_tuple__383)) __PYX_ERR(7, 403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__383);
  __Pyx_GIVEREF(__pyx_tuple__383);
  __pyx_codeobj__384 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__383, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_ipc_pxi, __pyx_n_s_get_tensor_size, 403, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__384)) __PYX_ERR(7, 403, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":413
 * 
 * 
 * def get_record_batch_size(RecordBatch batch):             # <<<<<<<<<<<<<<
 *     """
 *     Return total size of serialized RecordBatch including metadata and padding
 */
  __pyx_tuple__385 = PyTuple_Pack(2, __pyx_n_s_batch, __pyx_n_s_size); if (unlikely(!__pyx_tuple__385)) __PYX_ERR(7, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__385);
  __Pyx_GIVEREF(__pyx_tuple__385);
  __pyx_codeobj__386 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__385, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_ipc_pxi, __pyx_n_s_get_record_batch_size, 413, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__386)) __PYX_ERR(7, 413, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":423
 * 
 * 
 * def write_tensor(Tensor tensor, NativeFile dest):             # <<<<<<<<<<<<<<
 *     """
 *     Write pyarrow.Tensor to pyarrow.NativeFile object its current position
 */
  __pyx_tuple__387 = PyTuple_Pack(5, __pyx_n_s_tensor, __pyx_n_s_dest, __pyx_n_s_metadata_length, __pyx_n_s_body_length, __pyx_n_s_handle); if (unlikely(!__pyx_tuple__387)) __PYX_ERR(7, 423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__387);
  __Pyx_GIVEREF(__pyx_tuple__387);
  __pyx_codeobj__388 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__387, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_ipc_pxi, __pyx_n_s_write_tensor, 423, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__388)) __PYX_ERR(7, 423, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":451
 * 
 * 
 * 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__389 = PyTuple_Pack(3, __pyx_n_s_source, __pyx_n_s_sp_tensor, __pyx_n_s_rd_file); if (unlikely(!__pyx_tuple__389)) __PYX_ERR(7, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__389);
  __Pyx_GIVEREF(__pyx_tuple__389);
  __pyx_codeobj__390 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__389, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_ipc_pxi, __pyx_n_s_read_tensor, 451, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__390)) __PYX_ERR(7, 451, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":476
 * 
 * 
 * def read_message(source):             # <<<<<<<<<<<<<<
 *     """
 *     Read length-prefixed message from file or buffer-like object
 */
  __pyx_tuple__391 = PyTuple_Pack(4, __pyx_n_s_source, __pyx_n_s_result, __pyx_n_s_cpp_file, __pyx_n_s_rd_file); if (unlikely(!__pyx_tuple__391)) __PYX_ERR(7, 476, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__391);
  __Pyx_GIVEREF(__pyx_tuple__391);
  __pyx_codeobj__392 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__391, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_ipc_pxi, __pyx_n_s_read_message, 476, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__392)) __PYX_ERR(7, 476, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":512
 * 
 * 
 * def read_schema(obj):             # <<<<<<<<<<<<<<
 *     """
 *     Read Schema from message or buffer
 */
  __pyx_tuple__393 = PyTuple_Pack(3, __pyx_n_s_obj, __pyx_n_s_result, __pyx_n_s_cpp_file); if (unlikely(!__pyx_tuple__393)) __PYX_ERR(7, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__393);
  __Pyx_GIVEREF(__pyx_tuple__393);
  __pyx_codeobj__394 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__393, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_ipc_pxi, __pyx_n_s_read_schema, 512, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__394)) __PYX_ERR(7, 512, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":539
 * 
 * 
 * def read_record_batch(obj, Schema schema):             # <<<<<<<<<<<<<<
 *     """
 *     Read RecordBatch from message, given a known schema
 */
  __pyx_tuple__395 = PyTuple_Pack(4, __pyx_n_s_obj, __pyx_n_s_schema, __pyx_n_s_result, __pyx_n_s_message); if (unlikely(!__pyx_tuple__395)) __PYX_ERR(7, 539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__395);
  __Pyx_GIVEREF(__pyx_tuple__395);
  __pyx_codeobj__396 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__395, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_ipc_pxi, __pyx_n_s_read_record_batch, 539, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__396)) __PYX_ERR(7, 539, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":25
 * 
 * 
 * def is_named_tuple(cls):             # <<<<<<<<<<<<<<
 *     """Return True if cls is a namedtuple and False otherwise."""
 *     b = cls.__bases__
 */
  __pyx_tuple__397 = 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__397)) __PYX_ERR(14, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__397);
  __Pyx_GIVEREF(__pyx_tuple__397);
  __pyx_codeobj__398 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__397, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_is_named_tuple, 25, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__398)) __PYX_ERR(14, 25, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":37
 * 
 * class SerializationCallbackError(ArrowSerializationError):
 *     def __init__(self, message, example_object):             # <<<<<<<<<<<<<<
 *         ArrowSerializationError.__init__(self, message)
 *         self.example_object = example_object
 */
  __pyx_tuple__399 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_message, __pyx_n_s_example_object); if (unlikely(!__pyx_tuple__399)) __PYX_ERR(14, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__399);
  __Pyx_GIVEREF(__pyx_tuple__399);
  __pyx_codeobj__400 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__399, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_init, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__400)) __PYX_ERR(14, 37, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":43
 * 
 * class DeserializationCallbackError(ArrowSerializationError):
 *     def __init__(self, message, type_id):             # <<<<<<<<<<<<<<
 *         ArrowSerializationError.__init__(self, message)
 *         self.type_id = type_id
 */
  __pyx_tuple__401 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_message, __pyx_n_s_type_id); if (unlikely(!__pyx_tuple__401)) __PYX_ERR(14, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__401);
  __Pyx_GIVEREF(__pyx_tuple__401);
  __pyx_codeobj__402 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__401, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_init, 43, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__402)) __PYX_ERR(14, 43, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":223
 * 
 * 
 * def _get_default_context():             # <<<<<<<<<<<<<<
 *     global _default_context_initialized
 *     from pyarrow.serialization import register_default_serialization_handlers
 */
  __pyx_tuple__403 = PyTuple_Pack(1, __pyx_n_s_register_default_serialization_h); if (unlikely(!__pyx_tuple__403)) __PYX_ERR(14, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__403);
  __Pyx_GIVEREF(__pyx_tuple__403);
  __pyx_codeobj__404 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__403, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_get_default_context, 223, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__404)) __PYX_ERR(14, 223, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":291
 * 
 *     @staticmethod
 *     def from_components(components):             # <<<<<<<<<<<<<<
 *         """
 *         Reconstruct SerializedPyObject from output of
 */
  __pyx_tuple__405 = PyTuple_Pack(6, __pyx_n_s_components, __pyx_n_s_num_tensors, __pyx_n_s_num_ndarrays, __pyx_n_s_num_buffers, __pyx_n_s_buffers, __pyx_n_s_result); if (unlikely(!__pyx_tuple__405)) __PYX_ERR(14, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__405);
  __Pyx_GIVEREF(__pyx_tuple__405);
  __pyx_codeobj__406 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__405, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_from_components, 291, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__406)) __PYX_ERR(14, 291, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":333
 * 
 * 
 * def serialize(object value, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Serialize a Python sequence
 * 
 */
  __pyx_tuple__407 = PyTuple_Pack(4, __pyx_n_s_value, __pyx_n_s_context, __pyx_n_s_serialized, __pyx_n_s_wrapped_value); if (unlikely(!__pyx_tuple__407)) __PYX_ERR(14, 333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__407);
  __Pyx_GIVEREF(__pyx_tuple__407);
  __pyx_codeobj__408 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__407, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_serialize, 333, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__408)) __PYX_ERR(14, 333, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":359
 * 
 * 
 * def serialize_to(object value, sink, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Serialize a Python sequence to a file.
 * 
 */
  __pyx_tuple__409 = PyTuple_Pack(4, __pyx_n_s_value, __pyx_n_s_sink, __pyx_n_s_context, __pyx_n_s_serialized); if (unlikely(!__pyx_tuple__409)) __PYX_ERR(14, 359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__409);
  __Pyx_GIVEREF(__pyx_tuple__409);
  __pyx_codeobj__410 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__409, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_serialize_to, 359, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__410)) __PYX_ERR(14, 359, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":376
 * 
 * 
 * def read_serialized(source, base=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Read serialized Python sequence from file-like object
 * 
 */
  __pyx_tuple__411 = PyTuple_Pack(4, __pyx_n_s_source, __pyx_n_s_base, __pyx_n_s_stream, __pyx_n_s_serialized); if (unlikely(!__pyx_tuple__411)) __PYX_ERR(14, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__411);
  __Pyx_GIVEREF(__pyx_tuple__411);
  __pyx_codeobj__412 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__411, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_read_serialized, 376, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__412)) __PYX_ERR(14, 376, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":402
 * 
 * 
 * def deserialize_from(source, object base, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Deserialize a Python sequence from a file.
 * 
 */
  __pyx_tuple__413 = PyTuple_Pack(4, __pyx_n_s_source, __pyx_n_s_base, __pyx_n_s_context, __pyx_n_s_serialized); if (unlikely(!__pyx_tuple__413)) __PYX_ERR(14, 402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__413);
  __Pyx_GIVEREF(__pyx_tuple__413);
  __pyx_codeobj__414 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__413, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_deserialize_from, 402, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__414)) __PYX_ERR(14, 402, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":424
 * 
 * 
 * def deserialize_components(components, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """
 *     Reconstruct Python object from output of SerializedPyObject.to_components
 */
  __pyx_tuple__415 = PyTuple_Pack(3, __pyx_n_s_components, __pyx_n_s_context, __pyx_n_s_serialized); if (unlikely(!__pyx_tuple__415)) __PYX_ERR(14, 424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__415);
  __Pyx_GIVEREF(__pyx_tuple__415);
  __pyx_codeobj__416 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__415, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_deserialize_components, 424, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__416)) __PYX_ERR(14, 424, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":442
 * 
 * 
 * def deserialize(obj, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """
 *     EXPERIMENTAL: Deserialize Python object from Buffer or other Python object
 */
  __pyx_tuple__417 = PyTuple_Pack(3, __pyx_n_s_obj, __pyx_n_s_context, __pyx_n_s_source); if (unlikely(!__pyx_tuple__417)) __PYX_ERR(14, 442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__417);
  __Pyx_GIVEREF(__pyx_tuple__417);
  __pyx_codeobj__418 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__417, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_deserialize, 442, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__418)) __PYX_ERR(14, 442, __pyx_L1_error)

  /* "pyarrow/benchmark.pxi":19
 * 
 * 
 * def benchmark_PandasObjectIsNull(list obj):             # <<<<<<<<<<<<<<
 *     Benchmark_PandasObjectIsNull(obj)
 */
  __pyx_tuple__419 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__419)) __PYX_ERR(15, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__419);
  __Pyx_GIVEREF(__pyx_tuple__419);
  __pyx_codeobj__420 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__419, __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__420)) __PYX_ERR(15, 19, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __pyx_unpickle__PandasAPIShim(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_tuple__421 = 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__421)) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__421);
  __Pyx_GIVEREF(__pyx_tuple__421);
  __pyx_codeobj__422 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__421, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle__PandasAPIShim, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__422)) __PYX_ERR(9, 1, __pyx_L1_error)
  __pyx_tuple__423 = 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__423)) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__423);
  __Pyx_GIVEREF(__pyx_tuple__423);
  __pyx_codeobj__424 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__423, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Scalar, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__424)) __PYX_ERR(9, 1, __pyx_L1_error)
  __pyx_tuple__425 = 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__425)) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__425);
  __Pyx_GIVEREF(__pyx_tuple__425);
  __pyx_codeobj__426 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__425, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle__PandasConvertibl, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__426)) __PYX_ERR(9, 1, __pyx_L1_error)
  __pyx_tuple__427 = 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__427)) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__427);
  __Pyx_GIVEREF(__pyx_tuple__427);
  __pyx_codeobj__428 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__427, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_SerializationCont, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__428)) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  __pyx_umethod_PyDict_Type_update.type = (PyObject*)&PyDict_Type;
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(8, 1, __pyx_L1_error);
  __pyx_float_1e3 = PyFloat_FromDouble(1e3); if (unlikely(!__pyx_float_1e3)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_float_1e6 = PyFloat_FromDouble(1e6); if (unlikely(!__pyx_float_1e6)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_float_0_01 = PyFloat_FromDouble(0.01); if (unlikely(!__pyx_float_0_01)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_50 = PyInt_FromLong(50); if (unlikely(!__pyx_int_50)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_60 = PyInt_FromLong(60); if (unlikely(!__pyx_int_60)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_1970 = PyInt_FromLong(1970); if (unlikely(!__pyx_int_1970)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_65536 = PyInt_FromLong(65536L); if (unlikely(!__pyx_int_65536)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_86400 = PyInt_FromLong(86400L); if (unlikely(!__pyx_int_86400)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_1000000 = PyInt_FromLong(1000000L); if (unlikely(!__pyx_int_1000000)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_1686295 = PyInt_FromLong(1686295L); if (unlikely(!__pyx_int_1686295)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_93969614 = PyInt_FromLong(93969614L); if (unlikely(!__pyx_int_93969614)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_162458991 = PyInt_FromLong(162458991L); if (unlikely(!__pyx_int_162458991)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_222419149 = PyInt_FromLong(222419149L); if (unlikely(!__pyx_int_222419149)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_1000000000 = PyInt_FromLong(1000000000L); if (unlikely(!__pyx_int_1000000000)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(8, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/

static int __Pyx_modinit_global_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __pyx_v_7pyarrow_3lib_pandas_api = ((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__default_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__logging_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__pandas_type_map = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__pep3118_type_map = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__type_cache = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib_PRIMITIVE_TYPES = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__timestamp_type_cache = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__time_type_cache = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__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__array_value_classes = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__scalar_classes = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__global_ctx = ((struct __pyx_obj_7pyarrow_3lib__FunctionContext *)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__array_classes = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  if (__Pyx_ExportFunction("check_status", (void (*)(void))__pyx_f_7pyarrow_3lib_check_status, "int (arrow::Status const &)") < 0) __PYX_ERR(8, 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(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("wrap_array_output", (void (*)(void))__pyx_f_7pyarrow_3lib_wrap_array_output, "PyObject *(PyObject *)") < 0) __PYX_ERR(8, 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(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("get_input_stream", (void (*)(void))__pyx_f_7pyarrow_3lib_get_input_stream, "PyObject *(PyObject *, bool, std::shared_ptr<arrow::io::InputStream>  *)") < 0) __PYX_ERR(8, 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(8, 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(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("ensure_type", (void (*)(void))__pyx_f_7pyarrow_3lib_ensure_type, "struct __pyx_obj_7pyarrow_3lib_DataType *(PyObject *, struct __pyx_opt_args_7pyarrow_3lib_ensure_type *__pyx_optional_args)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_unwrap_metadata", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_unwrap_metadata, "std::shared_ptr< arrow::KeyValueMetadata>  (PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_wrap_metadata", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_wrap_metadata, "PyObject *(std::shared_ptr< arrow::KeyValueMetadata const >  const &)") < 0) __PYX_ERR(8, 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(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_wrap_chunked_array", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array, "PyObject *(std::shared_ptr< arrow::ChunkedArray>  const &)") < 0) __PYX_ERR(8, 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(8, 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(8, 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(8, 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(8, 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(8, 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(8, 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(8, 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(8, 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(8, 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(8, 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(8, 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(8, 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(8, 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(8, 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(8, 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(8, 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(8, 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(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_buffer", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_is_buffer, "int (PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_data_type", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_is_data_type, "int (PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_field", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_is_field, "int (PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_schema", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_is_schema, "int (PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_array", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_is_array, "int (PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_wrap_scalar", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_wrap_scalar, "PyObject *(std::shared_ptr< arrow::Scalar>  const &)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_tensor", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_is_tensor, "int (PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_column", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_is_column, "int (PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_table", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_is_table, "int (PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_batch", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_is_batch, "int (PyObject *)") < 0) __PYX_ERR(8, 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(7, 18, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Message.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Message.tp_dictoffset && __pyx_type_7pyarrow_3lib_Message.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Message.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Message, (PyObject *)&__pyx_type_7pyarrow_3lib_Message) < 0) __PYX_ERR(7, 18, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Message) < 0) __PYX_ERR(7, 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(10, 23, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_MemoryPool.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_MemoryPool.tp_dictoffset && __pyx_type_7pyarrow_3lib_MemoryPool.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_MemoryPool.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_MemoryPool.tp_dict, __pyx_vtabptr_7pyarrow_3lib_MemoryPool) < 0) __PYX_ERR(10, 23, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MemoryPool, (PyObject *)&__pyx_type_7pyarrow_3lib_MemoryPool) < 0) __PYX_ERR(10, 23, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_MemoryPool) < 0) __PYX_ERR(10, 23, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_MemoryPool = &__pyx_type_7pyarrow_3lib_MemoryPool;
  __pyx_vtabptr_7pyarrow_3lib_DataType = &__pyx_vtable_7pyarrow_3lib_DataType;
  __pyx_vtable_7pyarrow_3lib_DataType.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::DataType>  const &))__pyx_f_7pyarrow_3lib_8DataType_init;
  __pyx_vtable_7pyarrow_3lib_DataType.child = (struct __pyx_obj_7pyarrow_3lib_Field *(*)(struct __pyx_obj_7pyarrow_3lib_DataType *, int))__pyx_f_7pyarrow_3lib_8DataType_child;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_DataType) < 0) __PYX_ERR(4, 90, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_DataType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_DataType.tp_dictoffset && __pyx_type_7pyarrow_3lib_DataType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_DataType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_DataType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_DataType) < 0) __PYX_ERR(4, 90, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DataType, (PyObject *)&__pyx_type_7pyarrow_3lib_DataType) < 0) __PYX_ERR(4, 90, __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(4, 212, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_ListType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_ListType.tp_dictoffset && __pyx_type_7pyarrow_3lib_ListType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_ListType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_ListType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_ListType) < 0) __PYX_ERR(4, 212, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ListType, (PyObject *)&__pyx_type_7pyarrow_3lib_ListType) < 0) __PYX_ERR(4, 212, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_ListType = &__pyx_type_7pyarrow_3lib_ListType;
  __pyx_vtabptr_7pyarrow_3lib_StructType = &__pyx_vtable_7pyarrow_3lib_StructType;
  __pyx_vtable_7pyarrow_3lib_StructType.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_DataType;
  __pyx_vtable_7pyarrow_3lib_StructType.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::DataType>  const &))__pyx_f_7pyarrow_3lib_10StructType_init;
  __pyx_vtable_7pyarrow_3lib_StructType.field = (struct __pyx_obj_7pyarrow_3lib_Field *(*)(struct __pyx_obj_7pyarrow_3lib_StructType *, int))__pyx_f_7pyarrow_3lib_10StructType_field;
  __pyx_vtable_7pyarrow_3lib_StructType.field_by_name = (struct __pyx_obj_7pyarrow_3lib_Field *(*)(struct __pyx_obj_7pyarrow_3lib_StructType *, PyObject *))__pyx_f_7pyarrow_3lib_10StructType_field_by_name;
  __pyx_type_7pyarrow_3lib_StructType.tp_base = __pyx_ptype_7pyarrow_3lib_DataType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_StructType) < 0) __PYX_ERR(4, 232, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_StructType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_StructType.tp_dictoffset && __pyx_type_7pyarrow_3lib_StructType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_StructType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_StructType, "__len__"); if (unlikely(!wrapper)) __PYX_ERR(4, 232, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_10StructType___len__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_10StructType___len__.doc = __pyx_doc_7pyarrow_3lib_10StructType___len__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_10StructType___len__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_StructType, "__iter__"); if (unlikely(!wrapper)) __PYX_ERR(4, 232, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_10StructType_2__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_10StructType_2__iter__.doc = __pyx_doc_7pyarrow_3lib_10StructType_2__iter__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_10StructType_2__iter__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_StructType, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(4, 232, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_10StructType_5__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_10StructType_5__getitem__.doc = __pyx_doc_7pyarrow_3lib_10StructType_5__getitem__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_10StructType_5__getitem__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_StructType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_StructType) < 0) __PYX_ERR(4, 232, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StructType, (PyObject *)&__pyx_type_7pyarrow_3lib_StructType) < 0) __PYX_ERR(4, 232, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_StructType = &__pyx_type_7pyarrow_3lib_StructType;
  __pyx_vtabptr_7pyarrow_3lib_DictionaryType = &__pyx_vtable_7pyarrow_3lib_DictionaryType;
  __pyx_vtable_7pyarrow_3lib_DictionaryType.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_DataType;
  __pyx_vtable_7pyarrow_3lib_DictionaryType.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::DataType>  const &))__pyx_f_7pyarrow_3lib_14DictionaryType_init;
  __pyx_type_7pyarrow_3lib_DictionaryType.tp_base = __pyx_ptype_7pyarrow_3lib_DataType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_DictionaryType) < 0) __PYX_ERR(4, 177, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_DictionaryType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_DictionaryType.tp_dictoffset && __pyx_type_7pyarrow_3lib_DictionaryType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_DictionaryType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_DictionaryType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_DictionaryType) < 0) __PYX_ERR(4, 177, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DictionaryType, (PyObject *)&__pyx_type_7pyarrow_3lib_DictionaryType) < 0) __PYX_ERR(4, 177, __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(4, 357, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_TimestampType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_TimestampType.tp_dictoffset && __pyx_type_7pyarrow_3lib_TimestampType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_TimestampType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_TimestampType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_TimestampType) < 0) __PYX_ERR(4, 357, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TimestampType, (PyObject *)&__pyx_type_7pyarrow_3lib_TimestampType) < 0) __PYX_ERR(4, 357, __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(4, 398, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Time32Type.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Time32Type.tp_dictoffset && __pyx_type_7pyarrow_3lib_Time32Type.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Time32Type.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Time32Type.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Time32Type) < 0) __PYX_ERR(4, 398, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Time32Type, (PyObject *)&__pyx_type_7pyarrow_3lib_Time32Type) < 0) __PYX_ERR(4, 398, __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(4, 415, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Time64Type.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Time64Type.tp_dictoffset && __pyx_type_7pyarrow_3lib_Time64Type.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Time64Type.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Time64Type.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Time64Type) < 0) __PYX_ERR(4, 415, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Time64Type, (PyObject *)&__pyx_type_7pyarrow_3lib_Time64Type) < 0) __PYX_ERR(4, 415, __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(4, 432, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_FixedSizeBinaryType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_FixedSizeBinaryType.tp_dictoffset && __pyx_type_7pyarrow_3lib_FixedSizeBinaryType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_FixedSizeBinaryType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_FixedSizeBinaryType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryType) < 0) __PYX_ERR(4, 432, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FixedSizeBinaryType, (PyObject *)&__pyx_type_7pyarrow_3lib_FixedSizeBinaryType) < 0) __PYX_ERR(4, 432, __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(4, 453, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Decimal128Type.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Decimal128Type.tp_dictoffset && __pyx_type_7pyarrow_3lib_Decimal128Type.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Decimal128Type.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Decimal128Type.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Decimal128Type) < 0) __PYX_ERR(4, 453, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Decimal128Type, (PyObject *)&__pyx_type_7pyarrow_3lib_Decimal128Type) < 0) __PYX_ERR(4, 453, __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(4, 480, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Field.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Field.tp_dictoffset && __pyx_type_7pyarrow_3lib_Field.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Field.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Field.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Field) < 0) __PYX_ERR(4, 480, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Field, (PyObject *)&__pyx_type_7pyarrow_3lib_Field) < 0) __PYX_ERR(4, 480, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Field = &__pyx_type_7pyarrow_3lib_Field;
  __pyx_vtabptr_7pyarrow_3lib_Schema = &__pyx_vtable_7pyarrow_3lib_Schema;
  __pyx_vtable_7pyarrow_3lib_Schema.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_Schema *, std::vector<std::shared_ptr< arrow::Field> >  const &))__pyx_f_7pyarrow_3lib_6Schema_init;
  __pyx_vtable_7pyarrow_3lib_Schema.init_schema = (void (*)(struct __pyx_obj_7pyarrow_3lib_Schema *, std::shared_ptr< arrow::Schema>  const &))__pyx_f_7pyarrow_3lib_6Schema_init_schema;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Schema) < 0) __PYX_ERR(4, 598, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Schema.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Schema.tp_dictoffset && __pyx_type_7pyarrow_3lib_Schema.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Schema.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Schema.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Schema) < 0) __PYX_ERR(4, 598, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Schema, (PyObject *)&__pyx_type_7pyarrow_3lib_Schema) < 0) __PYX_ERR(4, 598, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Schema = &__pyx_type_7pyarrow_3lib_Schema;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Scalar) < 0) __PYX_ERR(5, 22, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Scalar.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Scalar.tp_dictoffset && __pyx_type_7pyarrow_3lib_Scalar.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Scalar.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Scalar, (PyObject *)&__pyx_type_7pyarrow_3lib_Scalar) < 0) __PYX_ERR(5, 22, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Scalar) < 0) __PYX_ERR(5, 22, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Scalar = &__pyx_type_7pyarrow_3lib_Scalar;
  __pyx_type_7pyarrow_3lib_NAType.tp_base = __pyx_ptype_7pyarrow_3lib_Scalar;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_NAType) < 0) __PYX_ERR(17, 127, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_NAType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_NAType.tp_dictoffset && __pyx_type_7pyarrow_3lib_NAType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_NAType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NAType, (PyObject *)&__pyx_type_7pyarrow_3lib_NAType) < 0) __PYX_ERR(17, 127, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_NAType = &__pyx_type_7pyarrow_3lib_NAType;
  __pyx_vtabptr_7pyarrow_3lib_ArrayValue = &__pyx_vtable_7pyarrow_3lib_ArrayValue;
  __pyx_vtable_7pyarrow_3lib_ArrayValue.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_ArrayValue *, struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::Array>  const &, int64_t))__pyx_f_7pyarrow_3lib_10ArrayValue_init;
  __pyx_vtable_7pyarrow_3lib_ArrayValue._set_array = (void (*)(struct __pyx_obj_7pyarrow_3lib_ArrayValue *, std::shared_ptr< arrow::Array>  const &))__pyx_f_7pyarrow_3lib_10ArrayValue__set_array;
  __pyx_type_7pyarrow_3lib_ArrayValue.tp_base = __pyx_ptype_7pyarrow_3lib_Scalar;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_ArrayValue) < 0) __PYX_ERR(5, 53, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_ArrayValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_ArrayValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_ArrayValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_ArrayValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_ArrayValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_ArrayValue) < 0) __PYX_ERR(5, 53, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ArrayValue, (PyObject *)&__pyx_type_7pyarrow_3lib_ArrayValue) < 0) __PYX_ERR(5, 53, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_ArrayValue) < 0) __PYX_ERR(5, 53, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_ArrayValue = &__pyx_type_7pyarrow_3lib_ArrayValue;
  __pyx_vtabptr_7pyarrow_3lib_ScalarValue = &__pyx_vtable_7pyarrow_3lib_ScalarValue;
  __pyx_vtable_7pyarrow_3lib_ScalarValue.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_ScalarValue *, std::shared_ptr< arrow::Scalar>  const &))__pyx_f_7pyarrow_3lib_11ScalarValue_init;
  __pyx_type_7pyarrow_3lib_ScalarValue.tp_base = __pyx_ptype_7pyarrow_3lib_Scalar;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_ScalarValue) < 0) __PYX_ERR(5, 665, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_ScalarValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_ScalarValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_ScalarValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_ScalarValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_ScalarValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_ScalarValue) < 0) __PYX_ERR(5, 665, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ScalarValue, (PyObject *)&__pyx_type_7pyarrow_3lib_ScalarValue) < 0) __PYX_ERR(5, 665, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_ScalarValue) < 0) __PYX_ERR(5, 665, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_ScalarValue = &__pyx_type_7pyarrow_3lib_ScalarValue;
  __pyx_vtabptr_7pyarrow_3lib_Int8Value = &__pyx_vtable_7pyarrow_3lib_Int8Value;
  __pyx_vtable_7pyarrow_3lib_Int8Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_Int8Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Int8Value) < 0) __PYX_ERR(5, 110, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int8Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int8Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int8Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int8Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int8Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int8Value) < 0) __PYX_ERR(5, 110, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int8Value, (PyObject *)&__pyx_type_7pyarrow_3lib_Int8Value) < 0) __PYX_ERR(5, 110, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Int8Value) < 0) __PYX_ERR(5, 110, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Int8Value = &__pyx_type_7pyarrow_3lib_Int8Value;
  __pyx_vtabptr_7pyarrow_3lib_Int64Value = &__pyx_vtable_7pyarrow_3lib_Int64Value;
  __pyx_vtable_7pyarrow_3lib_Int64Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_Int64Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Int64Value) < 0) __PYX_ERR(5, 188, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int64Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int64Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int64Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int64Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int64Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int64Value) < 0) __PYX_ERR(5, 188, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int64Value, (PyObject *)&__pyx_type_7pyarrow_3lib_Int64Value) < 0) __PYX_ERR(5, 188, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Int64Value) < 0) __PYX_ERR(5, 188, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Int64Value = &__pyx_type_7pyarrow_3lib_Int64Value;
  __pyx_vtabptr_7pyarrow_3lib_ListValue = &__pyx_vtable_7pyarrow_3lib_ListValue;
  __pyx_vtable_7pyarrow_3lib_ListValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_vtable_7pyarrow_3lib_ListValue.__pyx_base._set_array = (void (*)(struct __pyx_obj_7pyarrow_3lib_ArrayValue *, std::shared_ptr< arrow::Array>  const &))__pyx_f_7pyarrow_3lib_9ListValue__set_array;
  __pyx_vtable_7pyarrow_3lib_ListValue.getitem = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_ListValue *, int64_t))__pyx_f_7pyarrow_3lib_9ListValue_getitem;
  __pyx_vtable_7pyarrow_3lib_ListValue.length = (int64_t (*)(struct __pyx_obj_7pyarrow_3lib_ListValue *))__pyx_f_7pyarrow_3lib_9ListValue_length;
  __pyx_type_7pyarrow_3lib_ListValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_ListValue) < 0) __PYX_ERR(5, 462, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_ListValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_ListValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_ListValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_ListValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_ListValue, "__len__"); if (unlikely(!wrapper)) __PYX_ERR(5, 462, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_9ListValue___len__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_9ListValue___len__.doc = __pyx_doc_7pyarrow_3lib_9ListValue___len__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_9ListValue___len__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_ListValue, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(5, 462, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_9ListValue_2__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_9ListValue_2__getitem__.doc = __pyx_doc_7pyarrow_3lib_9ListValue_2__getitem__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_9ListValue_2__getitem__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_ListValue, "__iter__"); if (unlikely(!wrapper)) __PYX_ERR(5, 462, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_9ListValue_4__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_9ListValue_4__iter__.doc = __pyx_doc_7pyarrow_3lib_9ListValue_4__iter__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_9ListValue_4__iter__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_ListValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_ListValue) < 0) __PYX_ERR(5, 462, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ListValue, (PyObject *)&__pyx_type_7pyarrow_3lib_ListValue) < 0) __PYX_ERR(5, 462, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_ListValue) < 0) __PYX_ERR(5, 462, __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(5, 561, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_StructValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_StructValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_StructValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_StructValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_StructValue, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(5, 561, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_11StructValue___getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_11StructValue___getitem__.doc = __pyx_doc_7pyarrow_3lib_11StructValue___getitem__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_11StructValue___getitem__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_StructValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_StructValue) < 0) __PYX_ERR(5, 561, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StructValue, (PyObject *)&__pyx_type_7pyarrow_3lib_StructValue) < 0) __PYX_ERR(5, 561, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_StructValue) < 0) __PYX_ERR(5, 561, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_StructValue = &__pyx_type_7pyarrow_3lib_StructValue;
  __pyx_vtabptr_7pyarrow_3lib_UnionValue = &__pyx_vtable_7pyarrow_3lib_UnionValue;
  __pyx_vtable_7pyarrow_3lib_UnionValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_vtable_7pyarrow_3lib_UnionValue.__pyx_base._set_array = (void (*)(struct __pyx_obj_7pyarrow_3lib_ArrayValue *, std::shared_ptr< arrow::Array>  const &))__pyx_f_7pyarrow_3lib_10UnionValue__set_array;
  __pyx_vtable_7pyarrow_3lib_UnionValue.getitem = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_UnionValue *, int64_t))__pyx_f_7pyarrow_3lib_10UnionValue_getitem;
  __pyx_type_7pyarrow_3lib_UnionValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UnionValue) < 0) __PYX_ERR(5, 513, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UnionValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UnionValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_UnionValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UnionValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UnionValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UnionValue) < 0) __PYX_ERR(5, 513, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UnionValue, (PyObject *)&__pyx_type_7pyarrow_3lib_UnionValue) < 0) __PYX_ERR(5, 513, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_UnionValue) < 0) __PYX_ERR(5, 513, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_UnionValue = &__pyx_type_7pyarrow_3lib_UnionValue;
  __pyx_vtabptr_7pyarrow_3lib_StringValue = &__pyx_vtable_7pyarrow_3lib_StringValue;
  __pyx_vtable_7pyarrow_3lib_StringValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_StringValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_StringValue) < 0) __PYX_ERR(5, 419, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_StringValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_StringValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_StringValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_StringValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_StringValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_StringValue) < 0) __PYX_ERR(5, 419, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StringValue, (PyObject *)&__pyx_type_7pyarrow_3lib_StringValue) < 0) __PYX_ERR(5, 419, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_StringValue) < 0) __PYX_ERR(5, 419, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_StringValue = &__pyx_type_7pyarrow_3lib_StringValue;
  __pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryValue = &__pyx_vtable_7pyarrow_3lib_FixedSizeBinaryValue;
  __pyx_vtable_7pyarrow_3lib_FixedSizeBinaryValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_FixedSizeBinaryValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_FixedSizeBinaryValue) < 0) __PYX_ERR(5, 540, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_FixedSizeBinaryValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_FixedSizeBinaryValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_FixedSizeBinaryValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_FixedSizeBinaryValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_FixedSizeBinaryValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryValue) < 0) __PYX_ERR(5, 540, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FixedSizeBinaryValue, (PyObject *)&__pyx_type_7pyarrow_3lib_FixedSizeBinaryValue) < 0) __PYX_ERR(5, 540, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_FixedSizeBinaryValue) < 0) __PYX_ERR(5, 540, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_FixedSizeBinaryValue = &__pyx_type_7pyarrow_3lib_FixedSizeBinaryValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__PandasConvertible) < 0) __PYX_ERR(1, 342, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib__PandasConvertible.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib__PandasConvertible.tp_dictoffset && __pyx_type_7pyarrow_3lib__PandasConvertible.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib__PandasConvertible.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PandasConvertible, (PyObject *)&__pyx_type_7pyarrow_3lib__PandasConvertible) < 0) __PYX_ERR(1, 342, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__PandasConvertible) < 0) __PYX_ERR(1, 342, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib__PandasConvertible = &__pyx_type_7pyarrow_3lib__PandasConvertible;
  __pyx_vtabptr_7pyarrow_3lib_Array = &__pyx_vtable_7pyarrow_3lib_Array;
  __pyx_vtable_7pyarrow_3lib_Array.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_Array *, std::shared_ptr< arrow::Array>  const &))__pyx_f_7pyarrow_3lib_5Array_init;
  __pyx_vtable_7pyarrow_3lib_Array.getitem = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_Array *, int64_t))__pyx_f_7pyarrow_3lib_5Array_getitem;
  __pyx_vtable_7pyarrow_3lib_Array.length = (int64_t (*)(struct __pyx_obj_7pyarrow_3lib_Array *))__pyx_f_7pyarrow_3lib_5Array_length;
  __pyx_type_7pyarrow_3lib_Array.tp_base = __pyx_ptype_7pyarrow_3lib__PandasConvertible;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Array) < 0) __PYX_ERR(1, 394, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_Array, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(1, 394, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_5Array_35__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_5Array_35__getitem__.doc = __pyx_doc_7pyarrow_3lib_5Array_35__getitem__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_5Array_35__getitem__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Array) < 0) __PYX_ERR(1, 394, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Array) < 0) __PYX_ERR(1, 394, __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(1, 759, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Tensor.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Tensor.tp_dictoffset && __pyx_type_7pyarrow_3lib_Tensor.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Tensor.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Tensor.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Tensor) < 0) __PYX_ERR(1, 759, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Tensor, (PyObject *)&__pyx_type_7pyarrow_3lib_Tensor) < 0) __PYX_ERR(1, 759, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Tensor) < 0) __PYX_ERR(1, 759, __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(1, 869, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_NullArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_NullArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_NullArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_NullArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_NullArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_NullArray) < 0) __PYX_ERR(1, 869, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NullArray, (PyObject *)&__pyx_type_7pyarrow_3lib_NullArray) < 0) __PYX_ERR(1, 869, __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(1, 875, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_BooleanArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_BooleanArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_BooleanArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_BooleanArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_BooleanArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_BooleanArray) < 0) __PYX_ERR(1, 875, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BooleanArray, (PyObject *)&__pyx_type_7pyarrow_3lib_BooleanArray) < 0) __PYX_ERR(1, 875, __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(1, 881, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_NumericArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_NumericArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_NumericArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_NumericArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_NumericArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_NumericArray) < 0) __PYX_ERR(1, 881, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NumericArray, (PyObject *)&__pyx_type_7pyarrow_3lib_NumericArray) < 0) __PYX_ERR(1, 881, __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(1, 887, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_IntegerArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_IntegerArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_IntegerArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_IntegerArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_IntegerArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_IntegerArray) < 0) __PYX_ERR(1, 887, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_IntegerArray, (PyObject *)&__pyx_type_7pyarrow_3lib_IntegerArray) < 0) __PYX_ERR(1, 887, __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(1, 893, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_FloatingPointArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_FloatingPointArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_FloatingPointArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_FloatingPointArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_FloatingPointArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_FloatingPointArray) < 0) __PYX_ERR(1, 893, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FloatingPointArray, (PyObject *)&__pyx_type_7pyarrow_3lib_FloatingPointArray) < 0) __PYX_ERR(1, 893, __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(1, 899, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int8Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int8Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int8Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int8Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int8Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int8Array) < 0) __PYX_ERR(1, 899, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int8Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Int8Array) < 0) __PYX_ERR(1, 899, __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(1, 905, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt8Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt8Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt8Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt8Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt8Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt8Array) < 0) __PYX_ERR(1, 905, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt8Array, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt8Array) < 0) __PYX_ERR(1, 905, __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(1, 911, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int16Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int16Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int16Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int16Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int16Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int16Array) < 0) __PYX_ERR(1, 911, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int16Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Int16Array) < 0) __PYX_ERR(1, 911, __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(1, 917, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt16Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt16Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt16Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt16Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt16Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt16Array) < 0) __PYX_ERR(1, 917, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt16Array, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt16Array) < 0) __PYX_ERR(1, 917, __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(1, 923, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int32Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int32Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int32Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int32Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int32Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int32Array) < 0) __PYX_ERR(1, 923, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int32Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Int32Array) < 0) __PYX_ERR(1, 923, __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(1, 929, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt32Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt32Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt32Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt32Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt32Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt32Array) < 0) __PYX_ERR(1, 929, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt32Array, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt32Array) < 0) __PYX_ERR(1, 929, __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(1, 935, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int64Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int64Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int64Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int64Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int64Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int64Array) < 0) __PYX_ERR(1, 935, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int64Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Int64Array) < 0) __PYX_ERR(1, 935, __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(1, 941, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt64Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt64Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt64Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt64Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt64Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt64Array) < 0) __PYX_ERR(1, 941, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt64Array, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt64Array) < 0) __PYX_ERR(1, 941, __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(1, 977, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_HalfFloatArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_HalfFloatArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_HalfFloatArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_HalfFloatArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_HalfFloatArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_HalfFloatArray) < 0) __PYX_ERR(1, 977, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_HalfFloatArray, (PyObject *)&__pyx_type_7pyarrow_3lib_HalfFloatArray) < 0) __PYX_ERR(1, 977, __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(1, 983, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_FloatArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_FloatArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_FloatArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_FloatArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_FloatArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_FloatArray) < 0) __PYX_ERR(1, 983, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FloatArray, (PyObject *)&__pyx_type_7pyarrow_3lib_FloatArray) < 0) __PYX_ERR(1, 983, __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(1, 989, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_DoubleArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_DoubleArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_DoubleArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_DoubleArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_DoubleArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_DoubleArray) < 0) __PYX_ERR(1, 989, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DoubleArray, (PyObject *)&__pyx_type_7pyarrow_3lib_DoubleArray) < 0) __PYX_ERR(1, 989, __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(1, 995, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_FixedSizeBinaryArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_FixedSizeBinaryArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_FixedSizeBinaryArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_FixedSizeBinaryArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_FixedSizeBinaryArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryArray) < 0) __PYX_ERR(1, 995, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FixedSizeBinaryArray, (PyObject *)&__pyx_type_7pyarrow_3lib_FixedSizeBinaryArray) < 0) __PYX_ERR(1, 995, __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(1, 1001, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Decimal128Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Decimal128Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_Decimal128Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Decimal128Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Decimal128Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Decimal128Array) < 0) __PYX_ERR(1, 1001, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Decimal128Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Decimal128Array) < 0) __PYX_ERR(1, 1001, __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(1, 1250, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_StructArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_StructArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_StructArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_StructArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_StructArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_StructArray) < 0) __PYX_ERR(1, 1250, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StructArray, (PyObject *)&__pyx_type_7pyarrow_3lib_StructArray) < 0) __PYX_ERR(1, 1250, __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(1, 1007, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_ListArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_ListArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_ListArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_ListArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_ListArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_ListArray) < 0) __PYX_ERR(1, 1007, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ListArray, (PyObject *)&__pyx_type_7pyarrow_3lib_ListArray) < 0) __PYX_ERR(1, 1007, __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(1, 1051, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UnionArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UnionArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_UnionArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UnionArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UnionArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UnionArray) < 0) __PYX_ERR(1, 1051, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UnionArray, (PyObject *)&__pyx_type_7pyarrow_3lib_UnionArray) < 0) __PYX_ERR(1, 1051, __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(1, 1107, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_StringArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_StringArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_StringArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_StringArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_StringArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_StringArray) < 0) __PYX_ERR(1, 1107, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StringArray, (PyObject *)&__pyx_type_7pyarrow_3lib_StringArray) < 0) __PYX_ERR(1, 1107, __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(1, 1148, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_BinaryArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_BinaryArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_BinaryArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_BinaryArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_BinaryArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_BinaryArray) < 0) __PYX_ERR(1, 1148, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BinaryArray, (PyObject *)&__pyx_type_7pyarrow_3lib_BinaryArray) < 0) __PYX_ERR(1, 1148, __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(1, 1154, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_DictionaryArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_DictionaryArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_DictionaryArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_DictionaryArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_DictionaryArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_DictionaryArray) < 0) __PYX_ERR(1, 1154, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DictionaryArray, (PyObject *)&__pyx_type_7pyarrow_3lib_DictionaryArray) < 0) __PYX_ERR(1, 1154, __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;
  __pyx_type_7pyarrow_3lib_ChunkedArray.tp_base = __pyx_ptype_7pyarrow_3lib__PandasConvertible;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_ChunkedArray) < 0) __PYX_ERR(12, 18, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_ChunkedArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_ChunkedArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_ChunkedArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_ChunkedArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_ChunkedArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_ChunkedArray) < 0) __PYX_ERR(12, 18, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ChunkedArray, (PyObject *)&__pyx_type_7pyarrow_3lib_ChunkedArray) < 0) __PYX_ERR(12, 18, __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;
  __pyx_type_7pyarrow_3lib_Column.tp_base = __pyx_ptype_7pyarrow_3lib__PandasConvertible;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Column) < 0) __PYX_ERR(12, 349, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Column.tp_print = 0;
  #endif
  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(12, 349, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Column, (PyObject *)&__pyx_type_7pyarrow_3lib_Column) < 0) __PYX_ERR(12, 349, __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;
  __pyx_type_7pyarrow_3lib_Table.tp_base = __pyx_ptype_7pyarrow_3lib__PandasConvertible;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Table) < 0) __PYX_ERR(12, 936, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Table.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Table.tp_dictoffset && __pyx_type_7pyarrow_3lib_Table.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Table.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Table.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Table) < 0) __PYX_ERR(12, 936, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Table, (PyObject *)&__pyx_type_7pyarrow_3lib_Table) < 0) __PYX_ERR(12, 936, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Table = &__pyx_type_7pyarrow_3lib_Table;
  __pyx_vtabptr_7pyarrow_3lib_RecordBatch = &__pyx_vtable_7pyarrow_3lib_RecordBatch;
  __pyx_vtable_7pyarrow_3lib_RecordBatch.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_RecordBatch *, std::shared_ptr< arrow::RecordBatch>  const &))__pyx_f_7pyarrow_3lib_11RecordBatch_init;
  __pyx_type_7pyarrow_3lib_RecordBatch.tp_base = __pyx_ptype_7pyarrow_3lib__PandasConvertible;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_RecordBatch) < 0) __PYX_ERR(12, 627, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_RecordBatch.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_RecordBatch.tp_dictoffset && __pyx_type_7pyarrow_3lib_RecordBatch.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_RecordBatch.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_RecordBatch.tp_dict, __pyx_vtabptr_7pyarrow_3lib_RecordBatch) < 0) __PYX_ERR(12, 627, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RecordBatch, (PyObject *)&__pyx_type_7pyarrow_3lib_RecordBatch) < 0) __PYX_ERR(12, 627, __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(6, 830, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Buffer.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Buffer.tp_dictoffset && __pyx_type_7pyarrow_3lib_Buffer.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Buffer.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Buffer.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Buffer) < 0) __PYX_ERR(6, 830, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Buffer, (PyObject *)&__pyx_type_7pyarrow_3lib_Buffer) < 0) __PYX_ERR(6, 830, __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(6, 1001, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_ResizableBuffer.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_ResizableBuffer.tp_dictoffset && __pyx_type_7pyarrow_3lib_ResizableBuffer.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_ResizableBuffer.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_ResizableBuffer.tp_dict, __pyx_vtabptr_7pyarrow_3lib_ResizableBuffer) < 0) __PYX_ERR(6, 1001, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ResizableBuffer, (PyObject *)&__pyx_type_7pyarrow_3lib_ResizableBuffer) < 0) __PYX_ERR(6, 1001, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_ResizableBuffer = &__pyx_type_7pyarrow_3lib_ResizableBuffer;
  __pyx_vtabptr_7pyarrow_3lib_NativeFile = &__pyx_vtable_7pyarrow_3lib_NativeFile;
  __pyx_vtable_7pyarrow_3lib_NativeFile.set_random_access_file = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_NativeFile *, std::shared_ptr<arrow::io::RandomAccessFile> ))__pyx_f_7pyarrow_3lib_10NativeFile_set_random_access_file;
  __pyx_vtable_7pyarrow_3lib_NativeFile.set_input_stream = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_NativeFile *, std::shared_ptr<arrow::io::InputStream> ))__pyx_f_7pyarrow_3lib_10NativeFile_set_input_stream;
  __pyx_vtable_7pyarrow_3lib_NativeFile.set_output_stream = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_NativeFile *, std::shared_ptr<arrow::io::OutputStream> ))__pyx_f_7pyarrow_3lib_10NativeFile_set_output_stream;
  __pyx_vtable_7pyarrow_3lib_NativeFile.get_random_access_file = (std::shared_ptr<arrow::io::RandomAccessFile>  (*)(struct __pyx_obj_7pyarrow_3lib_NativeFile *))__pyx_f_7pyarrow_3lib_10NativeFile_get_random_access_file;
  __pyx_vtable_7pyarrow_3lib_NativeFile.get_input_stream = (std::shared_ptr<arrow::io::InputStream>  (*)(struct __pyx_obj_7pyarrow_3lib_NativeFile *))__pyx_f_7pyarrow_3lib_10NativeFile_get_input_stream;
  __pyx_vtable_7pyarrow_3lib_NativeFile.get_output_stream = (std::shared_ptr<arrow::io::OutputStream>  (*)(struct __pyx_obj_7pyarrow_3lib_NativeFile *))__pyx_f_7pyarrow_3lib_10NativeFile_get_output_stream;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_NativeFile) < 0) __PYX_ERR(6, 46, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_NativeFile.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_NativeFile.tp_dictoffset && __pyx_type_7pyarrow_3lib_NativeFile.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_NativeFile.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_NativeFile.tp_dict, __pyx_vtabptr_7pyarrow_3lib_NativeFile) < 0) __PYX_ERR(6, 46, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NativeFile, (PyObject *)&__pyx_type_7pyarrow_3lib_NativeFile) < 0) __PYX_ERR(6, 46, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_NativeFile.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_NativeFile.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_NativeFile, __weakref__);
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_NativeFile) < 0) __PYX_ERR(6, 46, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_NativeFile = &__pyx_type_7pyarrow_3lib_NativeFile;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__CRecordBatchWriter) < 0) __PYX_ERR(7, 151, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib__CRecordBatchWriter.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib__CRecordBatchWriter.tp_dictoffset && __pyx_type_7pyarrow_3lib__CRecordBatchWriter.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib__CRecordBatchWriter.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CRecordBatchWriter, (PyObject *)&__pyx_type_7pyarrow_3lib__CRecordBatchWriter) < 0) __PYX_ERR(7, 151, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__CRecordBatchWriter) < 0) __PYX_ERR(7, 151, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib__CRecordBatchWriter = &__pyx_type_7pyarrow_3lib__CRecordBatchWriter;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__CRecordBatchReader) < 0) __PYX_ERR(7, 255, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib__CRecordBatchReader.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib__CRecordBatchReader.tp_dictoffset && __pyx_type_7pyarrow_3lib__CRecordBatchReader.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib__CRecordBatchReader.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CRecordBatchReader, (PyObject *)&__pyx_type_7pyarrow_3lib__CRecordBatchReader) < 0) __PYX_ERR(7, 255, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__CRecordBatchReader) < 0) __PYX_ERR(7, 255, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib__CRecordBatchReader = &__pyx_type_7pyarrow_3lib__CRecordBatchReader;
  __pyx_vtabptr_7pyarrow_3lib__PandasAPIShim = &__pyx_vtable_7pyarrow_3lib__PandasAPIShim;
  __pyx_vtable_7pyarrow_3lib__PandasAPIShim._import_pandas = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, int))__pyx_f_7pyarrow_3lib_14_PandasAPIShim__import_pandas;
  __pyx_vtable_7pyarrow_3lib__PandasAPIShim._check_import = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, struct __pyx_opt_args_7pyarrow_3lib_14_PandasAPIShim__check_import *__pyx_optional_args))__pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import;
  __pyx_vtable_7pyarrow_3lib__PandasAPIShim._have_pandas_internal = (int (*)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *))__pyx_f_7pyarrow_3lib_14_PandasAPIShim__have_pandas_internal;
  __pyx_vtable_7pyarrow_3lib__PandasAPIShim.infer_dtype = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7pyarrow_3lib_14_PandasAPIShim_infer_dtype;
  __pyx_vtable_7pyarrow_3lib__PandasAPIShim.is_array_like = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_array_like;
  __pyx_vtable_7pyarrow_3lib__PandasAPIShim.is_categorical = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_categorical;
  __pyx_vtable_7pyarrow_3lib__PandasAPIShim.is_datetimetz = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_datetimetz;
  __pyx_vtable_7pyarrow_3lib__PandasAPIShim.is_data_frame = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_data_frame;
  __pyx_vtable_7pyarrow_3lib__PandasAPIShim.is_series = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_series;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__PandasAPIShim) < 0) __PYX_ERR(3, 20, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib__PandasAPIShim.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib__PandasAPIShim.tp_dictoffset && __pyx_type_7pyarrow_3lib__PandasAPIShim.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib__PandasAPIShim.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib__PandasAPIShim.tp_dict, __pyx_vtabptr_7pyarrow_3lib__PandasAPIShim) < 0) __PYX_ERR(3, 20, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PandasAPIShim, (PyObject *)&__pyx_type_7pyarrow_3lib__PandasAPIShim) < 0) __PYX_ERR(3, 20, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__PandasAPIShim) < 0) __PYX_ERR(3, 20, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib__PandasAPIShim = &__pyx_type_7pyarrow_3lib__PandasAPIShim;
  __pyx_vtabptr_7pyarrow_3lib_LoggingMemoryPool = &__pyx_vtable_7pyarrow_3lib_LoggingMemoryPool;
  __pyx_vtable_7pyarrow_3lib_LoggingMemoryPool.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_MemoryPool;
  __pyx_type_7pyarrow_3lib_LoggingMemoryPool.tp_base = __pyx_ptype_7pyarrow_3lib_MemoryPool;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_LoggingMemoryPool) < 0) __PYX_ERR(10, 65, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_LoggingMemoryPool.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_LoggingMemoryPool.tp_dictoffset && __pyx_type_7pyarrow_3lib_LoggingMemoryPool.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_LoggingMemoryPool.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_LoggingMemoryPool.tp_dict, __pyx_vtabptr_7pyarrow_3lib_LoggingMemoryPool) < 0) __PYX_ERR(10, 65, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LoggingMemoryPool, (PyObject *)&__pyx_type_7pyarrow_3lib_LoggingMemoryPool) < 0) __PYX_ERR(10, 65, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_LoggingMemoryPool) < 0) __PYX_ERR(10, 65, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_LoggingMemoryPool = &__pyx_type_7pyarrow_3lib_LoggingMemoryPool;
  __pyx_vtabptr_7pyarrow_3lib_ProxyMemoryPool = &__pyx_vtable_7pyarrow_3lib_ProxyMemoryPool;
  __pyx_vtable_7pyarrow_3lib_ProxyMemoryPool.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_MemoryPool;
  __pyx_type_7pyarrow_3lib_ProxyMemoryPool.tp_base = __pyx_ptype_7pyarrow_3lib_MemoryPool;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_ProxyMemoryPool) < 0) __PYX_ERR(10, 75, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_ProxyMemoryPool.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_ProxyMemoryPool.tp_dictoffset && __pyx_type_7pyarrow_3lib_ProxyMemoryPool.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_ProxyMemoryPool.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_ProxyMemoryPool.tp_dict, __pyx_vtabptr_7pyarrow_3lib_ProxyMemoryPool) < 0) __PYX_ERR(10, 75, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ProxyMemoryPool, (PyObject *)&__pyx_type_7pyarrow_3lib_ProxyMemoryPool) < 0) __PYX_ERR(10, 75, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_ProxyMemoryPool) < 0) __PYX_ERR(10, 75, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_ProxyMemoryPool = &__pyx_type_7pyarrow_3lib_ProxyMemoryPool;
  __pyx_vtabptr_7pyarrow_3lib_UnionType = &__pyx_vtable_7pyarrow_3lib_UnionType;
  __pyx_vtable_7pyarrow_3lib_UnionType.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_DataType;
  __pyx_vtable_7pyarrow_3lib_UnionType.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::DataType>  const &))__pyx_f_7pyarrow_3lib_9UnionType_init;
  __pyx_type_7pyarrow_3lib_UnionType.tp_base = __pyx_ptype_7pyarrow_3lib_DataType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UnionType) < 0) __PYX_ERR(4, 298, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UnionType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UnionType.tp_dictoffset && __pyx_type_7pyarrow_3lib_UnionType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UnionType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_UnionType, "__len__"); if (unlikely(!wrapper)) __PYX_ERR(4, 298, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_9UnionType___len__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_9UnionType___len__.doc = __pyx_doc_7pyarrow_3lib_9UnionType___len__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_9UnionType___len__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_UnionType, "__iter__"); if (unlikely(!wrapper)) __PYX_ERR(4, 298, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_9UnionType_2__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_9UnionType_2__iter__.doc = __pyx_doc_7pyarrow_3lib_9UnionType_2__iter__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_9UnionType_2__iter__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_UnionType, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(4, 298, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_9UnionType_5__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_9UnionType_5__getitem__.doc = __pyx_doc_7pyarrow_3lib_9UnionType_5__getitem__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_9UnionType_5__getitem__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UnionType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UnionType) < 0) __PYX_ERR(4, 298, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UnionType, (PyObject *)&__pyx_type_7pyarrow_3lib_UnionType) < 0) __PYX_ERR(4, 298, __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(5, 28, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_NullType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_NullType.tp_dictoffset && __pyx_type_7pyarrow_3lib_NullType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_NullType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NullType, (PyObject *)&__pyx_type_7pyarrow_3lib_NullType) < 0) __PYX_ERR(5, 28, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_NullType) < 0) __PYX_ERR(5, 28, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_NullType = &__pyx_type_7pyarrow_3lib_NullType;
  __pyx_vtabptr_7pyarrow_3lib_BooleanValue = &__pyx_vtable_7pyarrow_3lib_BooleanValue;
  __pyx_vtable_7pyarrow_3lib_BooleanValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_BooleanValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_BooleanValue) < 0) __PYX_ERR(5, 97, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_BooleanValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_BooleanValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_BooleanValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_BooleanValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_BooleanValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_BooleanValue) < 0) __PYX_ERR(5, 97, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BooleanValue, (PyObject *)&__pyx_type_7pyarrow_3lib_BooleanValue) < 0) __PYX_ERR(5, 97, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_BooleanValue) < 0) __PYX_ERR(5, 97, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_BooleanValue = &__pyx_type_7pyarrow_3lib_BooleanValue;
  __pyx_vtabptr_7pyarrow_3lib_UInt8Value = &__pyx_vtable_7pyarrow_3lib_UInt8Value;
  __pyx_vtable_7pyarrow_3lib_UInt8Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_UInt8Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UInt8Value) < 0) __PYX_ERR(5, 123, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt8Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt8Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt8Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt8Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt8Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt8Value) < 0) __PYX_ERR(5, 123, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt8Value, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt8Value) < 0) __PYX_ERR(5, 123, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_UInt8Value) < 0) __PYX_ERR(5, 123, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_UInt8Value = &__pyx_type_7pyarrow_3lib_UInt8Value;
  __pyx_vtabptr_7pyarrow_3lib_Int16Value = &__pyx_vtable_7pyarrow_3lib_Int16Value;
  __pyx_vtable_7pyarrow_3lib_Int16Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_Int16Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Int16Value) < 0) __PYX_ERR(5, 136, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int16Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int16Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int16Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int16Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int16Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int16Value) < 0) __PYX_ERR(5, 136, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int16Value, (PyObject *)&__pyx_type_7pyarrow_3lib_Int16Value) < 0) __PYX_ERR(5, 136, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Int16Value) < 0) __PYX_ERR(5, 136, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Int16Value = &__pyx_type_7pyarrow_3lib_Int16Value;
  __pyx_vtabptr_7pyarrow_3lib_UInt16Value = &__pyx_vtable_7pyarrow_3lib_UInt16Value;
  __pyx_vtable_7pyarrow_3lib_UInt16Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_UInt16Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UInt16Value) < 0) __PYX_ERR(5, 149, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt16Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt16Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt16Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt16Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt16Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt16Value) < 0) __PYX_ERR(5, 149, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt16Value, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt16Value) < 0) __PYX_ERR(5, 149, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_UInt16Value) < 0) __PYX_ERR(5, 149, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_UInt16Value = &__pyx_type_7pyarrow_3lib_UInt16Value;
  __pyx_vtabptr_7pyarrow_3lib_Int32Value = &__pyx_vtable_7pyarrow_3lib_Int32Value;
  __pyx_vtable_7pyarrow_3lib_Int32Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_Int32Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Int32Value) < 0) __PYX_ERR(5, 162, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int32Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int32Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int32Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int32Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int32Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int32Value) < 0) __PYX_ERR(5, 162, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int32Value, (PyObject *)&__pyx_type_7pyarrow_3lib_Int32Value) < 0) __PYX_ERR(5, 162, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Int32Value) < 0) __PYX_ERR(5, 162, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Int32Value = &__pyx_type_7pyarrow_3lib_Int32Value;
  __pyx_vtabptr_7pyarrow_3lib_UInt32Value = &__pyx_vtable_7pyarrow_3lib_UInt32Value;
  __pyx_vtable_7pyarrow_3lib_UInt32Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_UInt32Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UInt32Value) < 0) __PYX_ERR(5, 175, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt32Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt32Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt32Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt32Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt32Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt32Value) < 0) __PYX_ERR(5, 175, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt32Value, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt32Value) < 0) __PYX_ERR(5, 175, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_UInt32Value) < 0) __PYX_ERR(5, 175, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_UInt32Value = &__pyx_type_7pyarrow_3lib_UInt32Value;
  __pyx_vtabptr_7pyarrow_3lib_UInt64Value = &__pyx_vtable_7pyarrow_3lib_UInt64Value;
  __pyx_vtable_7pyarrow_3lib_UInt64Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_UInt64Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UInt64Value) < 0) __PYX_ERR(5, 201, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt64Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt64Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt64Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt64Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt64Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt64Value) < 0) __PYX_ERR(5, 201, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt64Value, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt64Value) < 0) __PYX_ERR(5, 201, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_UInt64Value) < 0) __PYX_ERR(5, 201, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_UInt64Value = &__pyx_type_7pyarrow_3lib_UInt64Value;
  __pyx_vtabptr_7pyarrow_3lib_Date32Value = &__pyx_vtable_7pyarrow_3lib_Date32Value;
  __pyx_vtable_7pyarrow_3lib_Date32Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_Date32Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Date32Value) < 0) __PYX_ERR(5, 214, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Date32Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Date32Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_Date32Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Date32Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Date32Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Date32Value) < 0) __PYX_ERR(5, 214, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Date32Value, (PyObject *)&__pyx_type_7pyarrow_3lib_Date32Value) < 0) __PYX_ERR(5, 214, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Date32Value) < 0) __PYX_ERR(5, 214, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Date32Value = &__pyx_type_7pyarrow_3lib_Date32Value;
  __pyx_vtabptr_7pyarrow_3lib_Date64Value = &__pyx_vtable_7pyarrow_3lib_Date64Value;
  __pyx_vtable_7pyarrow_3lib_Date64Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_Date64Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Date64Value) < 0) __PYX_ERR(5, 230, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Date64Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Date64Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_Date64Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Date64Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Date64Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Date64Value) < 0) __PYX_ERR(5, 230, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Date64Value, (PyObject *)&__pyx_type_7pyarrow_3lib_Date64Value) < 0) __PYX_ERR(5, 230, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Date64Value) < 0) __PYX_ERR(5, 230, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Date64Value = &__pyx_type_7pyarrow_3lib_Date64Value;
  __pyx_vtabptr_7pyarrow_3lib_Time32Value = &__pyx_vtable_7pyarrow_3lib_Time32Value;
  __pyx_vtable_7pyarrow_3lib_Time32Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_Time32Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Time32Value) < 0) __PYX_ERR(5, 244, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Time32Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Time32Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_Time32Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Time32Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Time32Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Time32Value) < 0) __PYX_ERR(5, 244, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Time32Value, (PyObject *)&__pyx_type_7pyarrow_3lib_Time32Value) < 0) __PYX_ERR(5, 244, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Time32Value) < 0) __PYX_ERR(5, 244, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Time32Value = &__pyx_type_7pyarrow_3lib_Time32Value;
  __pyx_vtabptr_7pyarrow_3lib_Time64Value = &__pyx_vtable_7pyarrow_3lib_Time64Value;
  __pyx_vtable_7pyarrow_3lib_Time64Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_Time64Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Time64Value) < 0) __PYX_ERR(5, 265, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Time64Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Time64Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_Time64Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Time64Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Time64Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Time64Value) < 0) __PYX_ERR(5, 265, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Time64Value, (PyObject *)&__pyx_type_7pyarrow_3lib_Time64Value) < 0) __PYX_ERR(5, 265, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Time64Value) < 0) __PYX_ERR(5, 265, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Time64Value = &__pyx_type_7pyarrow_3lib_Time64Value;
  __pyx_vtabptr_7pyarrow_3lib_TimestampValue = &__pyx_vtable_7pyarrow_3lib_TimestampValue;
  __pyx_vtable_7pyarrow_3lib_TimestampValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_TimestampValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_TimestampValue) < 0) __PYX_ERR(5, 330, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_TimestampValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_TimestampValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_TimestampValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_TimestampValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_TimestampValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_TimestampValue) < 0) __PYX_ERR(5, 330, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TimestampValue, (PyObject *)&__pyx_type_7pyarrow_3lib_TimestampValue) < 0) __PYX_ERR(5, 330, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_TimestampValue) < 0) __PYX_ERR(5, 330, __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(5, 365, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_HalfFloatValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_HalfFloatValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_HalfFloatValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_HalfFloatValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_HalfFloatValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_HalfFloatValue) < 0) __PYX_ERR(5, 365, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_HalfFloatValue, (PyObject *)&__pyx_type_7pyarrow_3lib_HalfFloatValue) < 0) __PYX_ERR(5, 365, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_HalfFloatValue) < 0) __PYX_ERR(5, 365, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_HalfFloatValue = &__pyx_type_7pyarrow_3lib_HalfFloatValue;
  __pyx_vtabptr_7pyarrow_3lib_FloatValue = &__pyx_vtable_7pyarrow_3lib_FloatValue;
  __pyx_vtable_7pyarrow_3lib_FloatValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_FloatValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_FloatValue) < 0) __PYX_ERR(5, 378, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_FloatValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_FloatValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_FloatValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_FloatValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_FloatValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_FloatValue) < 0) __PYX_ERR(5, 378, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FloatValue, (PyObject *)&__pyx_type_7pyarrow_3lib_FloatValue) < 0) __PYX_ERR(5, 378, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_FloatValue) < 0) __PYX_ERR(5, 378, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_FloatValue = &__pyx_type_7pyarrow_3lib_FloatValue;
  __pyx_vtabptr_7pyarrow_3lib_DoubleValue = &__pyx_vtable_7pyarrow_3lib_DoubleValue;
  __pyx_vtable_7pyarrow_3lib_DoubleValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_DoubleValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_DoubleValue) < 0) __PYX_ERR(5, 391, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_DoubleValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_DoubleValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_DoubleValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_DoubleValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_DoubleValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_DoubleValue) < 0) __PYX_ERR(5, 391, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DoubleValue, (PyObject *)&__pyx_type_7pyarrow_3lib_DoubleValue) < 0) __PYX_ERR(5, 391, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_DoubleValue) < 0) __PYX_ERR(5, 391, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_DoubleValue = &__pyx_type_7pyarrow_3lib_DoubleValue;
  __pyx_vtabptr_7pyarrow_3lib_DecimalValue = &__pyx_vtable_7pyarrow_3lib_DecimalValue;
  __pyx_vtable_7pyarrow_3lib_DecimalValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_DecimalValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_DecimalValue) < 0) __PYX_ERR(5, 404, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_DecimalValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_DecimalValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_DecimalValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_DecimalValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_DecimalValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_DecimalValue) < 0) __PYX_ERR(5, 404, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DecimalValue, (PyObject *)&__pyx_type_7pyarrow_3lib_DecimalValue) < 0) __PYX_ERR(5, 404, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_DecimalValue) < 0) __PYX_ERR(5, 404, __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(5, 432, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_BinaryValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_BinaryValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_BinaryValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_BinaryValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_BinaryValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_BinaryValue) < 0) __PYX_ERR(5, 432, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BinaryValue, (PyObject *)&__pyx_type_7pyarrow_3lib_BinaryValue) < 0) __PYX_ERR(5, 432, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_BinaryValue) < 0) __PYX_ERR(5, 432, __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(5, 604, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_DictionaryValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_DictionaryValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_DictionaryValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_DictionaryValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_DictionaryValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_DictionaryValue) < 0) __PYX_ERR(5, 604, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DictionaryValue, (PyObject *)&__pyx_type_7pyarrow_3lib_DictionaryValue) < 0) __PYX_ERR(5, 604, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_DictionaryValue) < 0) __PYX_ERR(5, 604, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_DictionaryValue = &__pyx_type_7pyarrow_3lib_DictionaryValue;
  __pyx_vtabptr_7pyarrow_3lib_UInt8Scalar = &__pyx_vtable_7pyarrow_3lib_UInt8Scalar;
  __pyx_vtable_7pyarrow_3lib_UInt8Scalar.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ScalarValue;
  __pyx_type_7pyarrow_3lib_UInt8Scalar.tp_base = __pyx_ptype_7pyarrow_3lib_ScalarValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UInt8Scalar) < 0) __PYX_ERR(5, 701, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt8Scalar.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt8Scalar.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt8Scalar.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt8Scalar.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt8Scalar.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt8Scalar) < 0) __PYX_ERR(5, 701, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt8Scalar, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt8Scalar) < 0) __PYX_ERR(5, 701, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_UInt8Scalar) < 0) __PYX_ERR(5, 701, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_UInt8Scalar = &__pyx_type_7pyarrow_3lib_UInt8Scalar;
  __pyx_vtabptr_7pyarrow_3lib_Int8Scalar = &__pyx_vtable_7pyarrow_3lib_Int8Scalar;
  __pyx_vtable_7pyarrow_3lib_Int8Scalar.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ScalarValue;
  __pyx_type_7pyarrow_3lib_Int8Scalar.tp_base = __pyx_ptype_7pyarrow_3lib_ScalarValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Int8Scalar) < 0) __PYX_ERR(5, 714, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int8Scalar.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int8Scalar.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int8Scalar.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int8Scalar.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int8Scalar.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int8Scalar) < 0) __PYX_ERR(5, 714, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int8Scalar, (PyObject *)&__pyx_type_7pyarrow_3lib_Int8Scalar) < 0) __PYX_ERR(5, 714, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Int8Scalar) < 0) __PYX_ERR(5, 714, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Int8Scalar = &__pyx_type_7pyarrow_3lib_Int8Scalar;
  __pyx_vtabptr_7pyarrow_3lib_UInt16Scalar = &__pyx_vtable_7pyarrow_3lib_UInt16Scalar;
  __pyx_vtable_7pyarrow_3lib_UInt16Scalar.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ScalarValue;
  __pyx_type_7pyarrow_3lib_UInt16Scalar.tp_base = __pyx_ptype_7pyarrow_3lib_ScalarValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UInt16Scalar) < 0) __PYX_ERR(5, 727, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt16Scalar.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt16Scalar.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt16Scalar.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt16Scalar.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt16Scalar.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt16Scalar) < 0) __PYX_ERR(5, 727, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt16Scalar, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt16Scalar) < 0) __PYX_ERR(5, 727, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_UInt16Scalar) < 0) __PYX_ERR(5, 727, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_UInt16Scalar = &__pyx_type_7pyarrow_3lib_UInt16Scalar;
  __pyx_vtabptr_7pyarrow_3lib_Int16Scalar = &__pyx_vtable_7pyarrow_3lib_Int16Scalar;
  __pyx_vtable_7pyarrow_3lib_Int16Scalar.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ScalarValue;
  __pyx_type_7pyarrow_3lib_Int16Scalar.tp_base = __pyx_ptype_7pyarrow_3lib_ScalarValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Int16Scalar) < 0) __PYX_ERR(5, 740, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int16Scalar.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int16Scalar.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int16Scalar.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int16Scalar.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int16Scalar.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int16Scalar) < 0) __PYX_ERR(5, 740, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int16Scalar, (PyObject *)&__pyx_type_7pyarrow_3lib_Int16Scalar) < 0) __PYX_ERR(5, 740, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Int16Scalar) < 0) __PYX_ERR(5, 740, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Int16Scalar = &__pyx_type_7pyarrow_3lib_Int16Scalar;
  __pyx_vtabptr_7pyarrow_3lib_UInt32Scalar = &__pyx_vtable_7pyarrow_3lib_UInt32Scalar;
  __pyx_vtable_7pyarrow_3lib_UInt32Scalar.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ScalarValue;
  __pyx_type_7pyarrow_3lib_UInt32Scalar.tp_base = __pyx_ptype_7pyarrow_3lib_ScalarValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UInt32Scalar) < 0) __PYX_ERR(5, 753, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt32Scalar.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt32Scalar.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt32Scalar.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt32Scalar.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt32Scalar.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt32Scalar) < 0) __PYX_ERR(5, 753, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt32Scalar, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt32Scalar) < 0) __PYX_ERR(5, 753, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_UInt32Scalar) < 0) __PYX_ERR(5, 753, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_UInt32Scalar = &__pyx_type_7pyarrow_3lib_UInt32Scalar;
  __pyx_vtabptr_7pyarrow_3lib_Int32Scalar = &__pyx_vtable_7pyarrow_3lib_Int32Scalar;
  __pyx_vtable_7pyarrow_3lib_Int32Scalar.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ScalarValue;
  __pyx_type_7pyarrow_3lib_Int32Scalar.tp_base = __pyx_ptype_7pyarrow_3lib_ScalarValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Int32Scalar) < 0) __PYX_ERR(5, 766, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int32Scalar.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int32Scalar.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int32Scalar.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int32Scalar.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int32Scalar.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int32Scalar) < 0) __PYX_ERR(5, 766, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int32Scalar, (PyObject *)&__pyx_type_7pyarrow_3lib_Int32Scalar) < 0) __PYX_ERR(5, 766, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Int32Scalar) < 0) __PYX_ERR(5, 766, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Int32Scalar = &__pyx_type_7pyarrow_3lib_Int32Scalar;
  __pyx_vtabptr_7pyarrow_3lib_UInt64Scalar = &__pyx_vtable_7pyarrow_3lib_UInt64Scalar;
  __pyx_vtable_7pyarrow_3lib_UInt64Scalar.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ScalarValue;
  __pyx_type_7pyarrow_3lib_UInt64Scalar.tp_base = __pyx_ptype_7pyarrow_3lib_ScalarValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UInt64Scalar) < 0) __PYX_ERR(5, 779, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt64Scalar.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt64Scalar.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt64Scalar.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt64Scalar.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt64Scalar.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt64Scalar) < 0) __PYX_ERR(5, 779, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt64Scalar, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt64Scalar) < 0) __PYX_ERR(5, 779, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_UInt64Scalar) < 0) __PYX_ERR(5, 779, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_UInt64Scalar = &__pyx_type_7pyarrow_3lib_UInt64Scalar;
  __pyx_vtabptr_7pyarrow_3lib_Int64Scalar = &__pyx_vtable_7pyarrow_3lib_Int64Scalar;
  __pyx_vtable_7pyarrow_3lib_Int64Scalar.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ScalarValue;
  __pyx_type_7pyarrow_3lib_Int64Scalar.tp_base = __pyx_ptype_7pyarrow_3lib_ScalarValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Int64Scalar) < 0) __PYX_ERR(5, 792, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int64Scalar.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int64Scalar.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int64Scalar.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int64Scalar.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int64Scalar.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int64Scalar) < 0) __PYX_ERR(5, 792, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int64Scalar, (PyObject *)&__pyx_type_7pyarrow_3lib_Int64Scalar) < 0) __PYX_ERR(5, 792, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Int64Scalar) < 0) __PYX_ERR(5, 792, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Int64Scalar = &__pyx_type_7pyarrow_3lib_Int64Scalar;
  __pyx_vtabptr_7pyarrow_3lib_FloatScalar = &__pyx_vtable_7pyarrow_3lib_FloatScalar;
  __pyx_vtable_7pyarrow_3lib_FloatScalar.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ScalarValue;
  __pyx_type_7pyarrow_3lib_FloatScalar.tp_base = __pyx_ptype_7pyarrow_3lib_ScalarValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_FloatScalar) < 0) __PYX_ERR(5, 805, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_FloatScalar.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_FloatScalar.tp_dictoffset && __pyx_type_7pyarrow_3lib_FloatScalar.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_FloatScalar.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_FloatScalar.tp_dict, __pyx_vtabptr_7pyarrow_3lib_FloatScalar) < 0) __PYX_ERR(5, 805, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FloatScalar, (PyObject *)&__pyx_type_7pyarrow_3lib_FloatScalar) < 0) __PYX_ERR(5, 805, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_FloatScalar) < 0) __PYX_ERR(5, 805, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_FloatScalar = &__pyx_type_7pyarrow_3lib_FloatScalar;
  __pyx_vtabptr_7pyarrow_3lib_DoubleScalar = &__pyx_vtable_7pyarrow_3lib_DoubleScalar;
  __pyx_vtable_7pyarrow_3lib_DoubleScalar.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ScalarValue;
  __pyx_type_7pyarrow_3lib_DoubleScalar.tp_base = __pyx_ptype_7pyarrow_3lib_ScalarValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_DoubleScalar) < 0) __PYX_ERR(5, 818, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_DoubleScalar.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_DoubleScalar.tp_dictoffset && __pyx_type_7pyarrow_3lib_DoubleScalar.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_DoubleScalar.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_DoubleScalar.tp_dict, __pyx_vtabptr_7pyarrow_3lib_DoubleScalar) < 0) __PYX_ERR(5, 818, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DoubleScalar, (PyObject *)&__pyx_type_7pyarrow_3lib_DoubleScalar) < 0) __PYX_ERR(5, 818, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_DoubleScalar) < 0) __PYX_ERR(5, 818, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_DoubleScalar = &__pyx_type_7pyarrow_3lib_DoubleScalar;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__FunctionContext) < 0) __PYX_ERR(1, 238, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib__FunctionContext.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib__FunctionContext.tp_dictoffset && __pyx_type_7pyarrow_3lib__FunctionContext.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib__FunctionContext.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FunctionContext, (PyObject *)&__pyx_type_7pyarrow_3lib__FunctionContext) < 0) __PYX_ERR(1, 238, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__FunctionContext) < 0) __PYX_ERR(1, 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(1, 947, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Date32Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Date32Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_Date32Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Date32Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Date32Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Date32Array) < 0) __PYX_ERR(1, 947, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Date32Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Date32Array) < 0) __PYX_ERR(1, 947, __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(1, 953, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Date64Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Date64Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_Date64Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Date64Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Date64Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Date64Array) < 0) __PYX_ERR(1, 953, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Date64Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Date64Array) < 0) __PYX_ERR(1, 953, __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(1, 959, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_TimestampArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_TimestampArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_TimestampArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_TimestampArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_TimestampArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_TimestampArray) < 0) __PYX_ERR(1, 959, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TimestampArray, (PyObject *)&__pyx_type_7pyarrow_3lib_TimestampArray) < 0) __PYX_ERR(1, 959, __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(1, 965, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Time32Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Time32Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_Time32Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Time32Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Time32Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Time32Array) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Time32Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Time32Array) < 0) __PYX_ERR(1, 965, __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(1, 971, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Time64Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Time64Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_Time64Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Time64Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Time64Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Time64Array) < 0) __PYX_ERR(1, 971, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Time64Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Time64Array) < 0) __PYX_ERR(1, 971, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Time64Array = &__pyx_type_7pyarrow_3lib_Time64Array;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_StringBuilder) < 0) __PYX_ERR(11, 23, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_StringBuilder.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_StringBuilder.tp_dictoffset && __pyx_type_7pyarrow_3lib_StringBuilder.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_StringBuilder.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StringBuilder, (PyObject *)&__pyx_type_7pyarrow_3lib_StringBuilder) < 0) __PYX_ERR(11, 23, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_StringBuilder) < 0) __PYX_ERR(11, 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(6, 571, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_PythonFile.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_PythonFile.tp_dictoffset && __pyx_type_7pyarrow_3lib_PythonFile.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_PythonFile.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_PythonFile.tp_dict, __pyx_vtabptr_7pyarrow_3lib_PythonFile) < 0) __PYX_ERR(6, 571, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PythonFile, (PyObject *)&__pyx_type_7pyarrow_3lib_PythonFile) < 0) __PYX_ERR(6, 571, __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(6, 571, __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(6, 649, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_MemoryMappedFile.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_MemoryMappedFile.tp_dictoffset && __pyx_type_7pyarrow_3lib_MemoryMappedFile.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_MemoryMappedFile.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_MemoryMappedFile.tp_dict, __pyx_vtabptr_7pyarrow_3lib_MemoryMappedFile) < 0) __PYX_ERR(6, 649, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MemoryMappedFile, (PyObject *)&__pyx_type_7pyarrow_3lib_MemoryMappedFile) < 0) __PYX_ERR(6, 649, __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(6, 649, __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(6, 760, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_OSFile.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_OSFile.tp_dictoffset && __pyx_type_7pyarrow_3lib_OSFile.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_OSFile.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_OSFile.tp_dict, __pyx_vtabptr_7pyarrow_3lib_OSFile) < 0) __PYX_ERR(6, 760, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_OSFile, (PyObject *)&__pyx_type_7pyarrow_3lib_OSFile) < 0) __PYX_ERR(6, 760, __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(6, 760, __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(6, 801, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_FixedSizeBufferWriter.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_FixedSizeBufferWriter.tp_dictoffset && __pyx_type_7pyarrow_3lib_FixedSizeBufferWriter.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_FixedSizeBufferWriter.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_FixedSizeBufferWriter.tp_dict, __pyx_vtabptr_7pyarrow_3lib_FixedSizeBufferWriter) < 0) __PYX_ERR(6, 801, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FixedSizeBufferWriter, (PyObject *)&__pyx_type_7pyarrow_3lib_FixedSizeBufferWriter) < 0) __PYX_ERR(6, 801, __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(6, 801, __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(6, 1069, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_BufferOutputStream.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_BufferOutputStream.tp_dictoffset && __pyx_type_7pyarrow_3lib_BufferOutputStream.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_BufferOutputStream.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_BufferOutputStream.tp_dict, __pyx_vtabptr_7pyarrow_3lib_BufferOutputStream) < 0) __PYX_ERR(6, 1069, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BufferOutputStream, (PyObject *)&__pyx_type_7pyarrow_3lib_BufferOutputStream) < 0) __PYX_ERR(6, 1069, __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(6, 1069, __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(6, 1093, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_MockOutputStream.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_MockOutputStream.tp_dictoffset && __pyx_type_7pyarrow_3lib_MockOutputStream.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_MockOutputStream.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_MockOutputStream.tp_dict, __pyx_vtabptr_7pyarrow_3lib_MockOutputStream) < 0) __PYX_ERR(6, 1093, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MockOutputStream, (PyObject *)&__pyx_type_7pyarrow_3lib_MockOutputStream) < 0) __PYX_ERR(6, 1093, __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(6, 1093, __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(6, 1104, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_BufferReader.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_BufferReader.tp_dictoffset && __pyx_type_7pyarrow_3lib_BufferReader.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_BufferReader.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_BufferReader.tp_dict, __pyx_vtabptr_7pyarrow_3lib_BufferReader) < 0) __PYX_ERR(6, 1104, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BufferReader, (PyObject *)&__pyx_type_7pyarrow_3lib_BufferReader) < 0) __PYX_ERR(6, 1104, __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(6, 1104, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_BufferReader = &__pyx_type_7pyarrow_3lib_BufferReader;
  __pyx_vtabptr_7pyarrow_3lib_CompressedInputStream = &__pyx_vtable_7pyarrow_3lib_CompressedInputStream;
  __pyx_vtable_7pyarrow_3lib_CompressedInputStream.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NativeFile;
  __pyx_type_7pyarrow_3lib_CompressedInputStream.tp_base = __pyx_ptype_7pyarrow_3lib_NativeFile;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_CompressedInputStream) < 0) __PYX_ERR(6, 1122, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_CompressedInputStream.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_CompressedInputStream.tp_dictoffset && __pyx_type_7pyarrow_3lib_CompressedInputStream.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_CompressedInputStream.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_CompressedInputStream.tp_dict, __pyx_vtabptr_7pyarrow_3lib_CompressedInputStream) < 0) __PYX_ERR(6, 1122, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CompressedInputStream, (PyObject *)&__pyx_type_7pyarrow_3lib_CompressedInputStream) < 0) __PYX_ERR(6, 1122, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_CompressedInputStream.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_CompressedInputStream.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_CompressedInputStream, __pyx_base.__weakref__);
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_CompressedInputStream) < 0) __PYX_ERR(6, 1122, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_CompressedInputStream = &__pyx_type_7pyarrow_3lib_CompressedInputStream;
  __pyx_vtabptr_7pyarrow_3lib_CompressedOutputStream = &__pyx_vtable_7pyarrow_3lib_CompressedOutputStream;
  __pyx_vtable_7pyarrow_3lib_CompressedOutputStream.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NativeFile;
  __pyx_type_7pyarrow_3lib_CompressedOutputStream.tp_base = __pyx_ptype_7pyarrow_3lib_NativeFile;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_CompressedOutputStream) < 0) __PYX_ERR(6, 1152, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_CompressedOutputStream.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_CompressedOutputStream.tp_dictoffset && __pyx_type_7pyarrow_3lib_CompressedOutputStream.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_CompressedOutputStream.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_CompressedOutputStream.tp_dict, __pyx_vtabptr_7pyarrow_3lib_CompressedOutputStream) < 0) __PYX_ERR(6, 1152, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CompressedOutputStream, (PyObject *)&__pyx_type_7pyarrow_3lib_CompressedOutputStream) < 0) __PYX_ERR(6, 1152, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_CompressedOutputStream.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_CompressedOutputStream.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream, __pyx_base.__weakref__);
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_CompressedOutputStream) < 0) __PYX_ERR(6, 1152, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_CompressedOutputStream = &__pyx_type_7pyarrow_3lib_CompressedOutputStream;
  __pyx_vtabptr_7pyarrow_3lib_BufferedInputStream = &__pyx_vtable_7pyarrow_3lib_BufferedInputStream;
  __pyx_vtable_7pyarrow_3lib_BufferedInputStream.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NativeFile;
  __pyx_type_7pyarrow_3lib_BufferedInputStream.tp_base = __pyx_ptype_7pyarrow_3lib_NativeFile;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_BufferedInputStream) < 0) __PYX_ERR(6, 1183, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_BufferedInputStream.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_BufferedInputStream.tp_dictoffset && __pyx_type_7pyarrow_3lib_BufferedInputStream.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_BufferedInputStream.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_BufferedInputStream.tp_dict, __pyx_vtabptr_7pyarrow_3lib_BufferedInputStream) < 0) __PYX_ERR(6, 1183, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BufferedInputStream, (PyObject *)&__pyx_type_7pyarrow_3lib_BufferedInputStream) < 0) __PYX_ERR(6, 1183, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_BufferedInputStream.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_BufferedInputStream.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_BufferedInputStream, __pyx_base.__weakref__);
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_BufferedInputStream) < 0) __PYX_ERR(6, 1183, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_BufferedInputStream = &__pyx_type_7pyarrow_3lib_BufferedInputStream;
  __pyx_vtabptr_7pyarrow_3lib_BufferedOutputStream = &__pyx_vtable_7pyarrow_3lib_BufferedOutputStream;
  __pyx_vtable_7pyarrow_3lib_BufferedOutputStream.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NativeFile;
  __pyx_type_7pyarrow_3lib_BufferedOutputStream.tp_base = __pyx_ptype_7pyarrow_3lib_NativeFile;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_BufferedOutputStream) < 0) __PYX_ERR(6, 1199, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_BufferedOutputStream.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_BufferedOutputStream.tp_dictoffset && __pyx_type_7pyarrow_3lib_BufferedOutputStream.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_BufferedOutputStream.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_BufferedOutputStream.tp_dict, __pyx_vtabptr_7pyarrow_3lib_BufferedOutputStream) < 0) __PYX_ERR(6, 1199, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BufferedOutputStream, (PyObject *)&__pyx_type_7pyarrow_3lib_BufferedOutputStream) < 0) __PYX_ERR(6, 1199, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_BufferedOutputStream.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_BufferedOutputStream.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream, __pyx_base.__weakref__);
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_BufferedOutputStream) < 0) __PYX_ERR(6, 1199, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_BufferedOutputStream = &__pyx_type_7pyarrow_3lib_BufferedOutputStream;
  __pyx_vtabptr_7pyarrow_3lib_HadoopFileSystem = &__pyx_vtable_7pyarrow_3lib_HadoopFileSystem;
  __pyx_vtable_7pyarrow_3lib_HadoopFileSystem._ensure_client = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *))__pyx_f_7pyarrow_3lib_16HadoopFileSystem__ensure_client;
  __pyx_vtable_7pyarrow_3lib_HadoopFileSystem._path_info = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *, PyObject *, arrow::io::HdfsPathInfo *))__pyx_f_7pyarrow_3lib_16HadoopFileSystem__path_info;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_HadoopFileSystem) < 0) __PYX_ERR(2, 56, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_HadoopFileSystem.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_HadoopFileSystem.tp_dictoffset && __pyx_type_7pyarrow_3lib_HadoopFileSystem.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_HadoopFileSystem.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_HadoopFileSystem.tp_dict, __pyx_vtabptr_7pyarrow_3lib_HadoopFileSystem) < 0) __PYX_ERR(2, 56, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_HadoopFileSystem, (PyObject *)&__pyx_type_7pyarrow_3lib_HadoopFileSystem) < 0) __PYX_ERR(2, 56, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_HadoopFileSystem) < 0) __PYX_ERR(2, 56, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_HadoopFileSystem = &__pyx_type_7pyarrow_3lib_HadoopFileSystem;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__HdfsFileNanny) < 0) __PYX_ERR(2, 466, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib__HdfsFileNanny.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib__HdfsFileNanny.tp_dictoffset && __pyx_type_7pyarrow_3lib__HdfsFileNanny.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib__HdfsFileNanny.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_HdfsFileNanny, (PyObject *)&__pyx_type_7pyarrow_3lib__HdfsFileNanny) < 0) __PYX_ERR(2, 466, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__HdfsFileNanny) < 0) __PYX_ERR(2, 466, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib__HdfsFileNanny = &__pyx_type_7pyarrow_3lib__HdfsFileNanny;
  __pyx_vtabptr_7pyarrow_3lib_HdfsFile = &__pyx_vtable_7pyarrow_3lib_HdfsFile;
  __pyx_vtable_7pyarrow_3lib_HdfsFile.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NativeFile;
  __pyx_type_7pyarrow_3lib_HdfsFile.tp_base = __pyx_ptype_7pyarrow_3lib_NativeFile;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_HdfsFile) < 0) __PYX_ERR(2, 485, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_HdfsFile.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_HdfsFile.tp_dictoffset && __pyx_type_7pyarrow_3lib_HdfsFile.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_HdfsFile.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_HdfsFile.tp_dict, __pyx_vtabptr_7pyarrow_3lib_HdfsFile) < 0) __PYX_ERR(2, 485, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_HdfsFile, (PyObject *)&__pyx_type_7pyarrow_3lib_HdfsFile) < 0) __PYX_ERR(2, 485, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_HdfsFile.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_HdfsFile.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_HdfsFile, __pyx_base.__weakref__);
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_HdfsFile) < 0) __PYX_ERR(2, 485, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_HdfsFile = &__pyx_type_7pyarrow_3lib_HdfsFile;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_MessageReader) < 0) __PYX_ERR(7, 101, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_MessageReader.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_MessageReader.tp_dictoffset && __pyx_type_7pyarrow_3lib_MessageReader.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_MessageReader.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MessageReader, (PyObject *)&__pyx_type_7pyarrow_3lib_MessageReader) < 0) __PYX_ERR(7, 101, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_MessageReader) < 0) __PYX_ERR(7, 101, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_MessageReader = &__pyx_type_7pyarrow_3lib_MessageReader;
  __pyx_type_7pyarrow_3lib__RecordBatchStreamWriter.tp_base = __pyx_ptype_7pyarrow_3lib__CRecordBatchWriter;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__RecordBatchStreamWriter) < 0) __PYX_ERR(7, 220, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib__RecordBatchStreamWriter.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib__RecordBatchStreamWriter.tp_dictoffset && __pyx_type_7pyarrow_3lib__RecordBatchStreamWriter.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib__RecordBatchStreamWriter.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RecordBatchStreamWriter, (PyObject *)&__pyx_type_7pyarrow_3lib__RecordBatchStreamWriter) < 0) __PYX_ERR(7, 220, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__RecordBatchStreamWriter) < 0) __PYX_ERR(7, 220, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib__RecordBatchStreamWriter = &__pyx_type_7pyarrow_3lib__RecordBatchStreamWriter;
  __pyx_type_7pyarrow_3lib__RecordBatchStreamReader.tp_base = __pyx_ptype_7pyarrow_3lib__CRecordBatchReader;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__RecordBatchStreamReader) < 0) __PYX_ERR(7, 299, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib__RecordBatchStreamReader.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib__RecordBatchStreamReader.tp_dictoffset && __pyx_type_7pyarrow_3lib__RecordBatchStreamReader.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib__RecordBatchStreamReader.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RecordBatchStreamReader, (PyObject *)&__pyx_type_7pyarrow_3lib__RecordBatchStreamReader) < 0) __PYX_ERR(7, 299, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__RecordBatchStreamReader) < 0) __PYX_ERR(7, 299, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib__RecordBatchStreamReader = &__pyx_type_7pyarrow_3lib__RecordBatchStreamReader;
  __pyx_type_7pyarrow_3lib__RecordBatchFileWriter.tp_base = __pyx_ptype_7pyarrow_3lib__RecordBatchStreamWriter;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__RecordBatchFileWriter) < 0) __PYX_ERR(7, 318, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib__RecordBatchFileWriter.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib__RecordBatchFileWriter.tp_dictoffset && __pyx_type_7pyarrow_3lib__RecordBatchFileWriter.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib__RecordBatchFileWriter.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RecordBatchFileWriter, (PyObject *)&__pyx_type_7pyarrow_3lib__RecordBatchFileWriter) < 0) __PYX_ERR(7, 318, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__RecordBatchFileWriter) < 0) __PYX_ERR(7, 318, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib__RecordBatchFileWriter = &__pyx_type_7pyarrow_3lib__RecordBatchFileWriter;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__RecordBatchFileReader) < 0) __PYX_ERR(7, 329, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib__RecordBatchFileReader.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib__RecordBatchFileReader.tp_dictoffset && __pyx_type_7pyarrow_3lib__RecordBatchFileReader.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib__RecordBatchFileReader.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RecordBatchFileReader, (PyObject *)&__pyx_type_7pyarrow_3lib__RecordBatchFileReader) < 0) __PYX_ERR(7, 329, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__RecordBatchFileReader) < 0) __PYX_ERR(7, 329, __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)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_FeatherWriter.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_FeatherWriter.tp_dictoffset && __pyx_type_7pyarrow_3lib_FeatherWriter.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_FeatherWriter.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FeatherWriter, (PyObject *)&__pyx_type_7pyarrow_3lib_FeatherWriter) < 0) __PYX_ERR(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)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_FeatherReader.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_FeatherReader.tp_dictoffset && __pyx_type_7pyarrow_3lib_FeatherReader.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_FeatherReader.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FeatherReader, (PyObject *)&__pyx_type_7pyarrow_3lib_FeatherReader) < 0) __PYX_ERR(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, 48, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_SerializationContext.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_SerializationContext.tp_dictoffset && __pyx_type_7pyarrow_3lib_SerializationContext.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_SerializationContext.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SerializationContext, (PyObject *)&__pyx_type_7pyarrow_3lib_SerializationContext) < 0) __PYX_ERR(14, 48, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_SerializationContext) < 0) __PYX_ERR(14, 48, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_SerializationContext = &__pyx_type_7pyarrow_3lib_SerializationContext;
  __pyx_vtabptr_7pyarrow_3lib_SerializedPyObject = &__pyx_vtable_7pyarrow_3lib_SerializedPyObject;
  __pyx_vtable_7pyarrow_3lib_SerializedPyObject._write_to = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *, arrow::io::OutputStream *))__pyx_f_7pyarrow_3lib_18SerializedPyObject__write_to;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_SerializedPyObject) < 0) __PYX_ERR(14, 232, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_SerializedPyObject.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_SerializedPyObject.tp_dictoffset && __pyx_type_7pyarrow_3lib_SerializedPyObject.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_SerializedPyObject.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_SerializedPyObject.tp_dict, __pyx_vtabptr_7pyarrow_3lib_SerializedPyObject) < 0) __PYX_ERR(14, 232, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SerializedPyObject, (PyObject *)&__pyx_type_7pyarrow_3lib_SerializedPyObject) < 0) __PYX_ERR(14, 232, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_SerializedPyObject) < 0) __PYX_ERR(14, 232, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_SerializedPyObject = &__pyx_type_7pyarrow_3lib_SerializedPyObject;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct____iter__) < 0) __PYX_ERR(4, 269, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct____iter__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct____iter__.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct____iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct____iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct____iter__ = &__pyx_type_7pyarrow_3lib___pyx_scope_struct____iter__;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_1___iter__) < 0) __PYX_ERR(4, 340, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_1___iter__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_1___iter__.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_1___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_1___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_1___iter__ = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_1___iter__;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_2___iter__) < 0) __PYX_ERR(4, 614, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_2___iter__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_2___iter__.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_2___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_2___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_2___iter__ = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_2___iter__;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions) < 0) __PYX_ERR(5, 290, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_3___pyx_f_7pyarrow_3lib__datetime_conversion_functions;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_4___iter__) < 0) __PYX_ERR(5, 479, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_4___iter__.tp_print = 0;
  #endif
  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(1, 592, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_5___iter__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_5___iter__.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_5___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_5___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_5___iter__ = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_5___iter__;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_6___iter__) < 0) __PYX_ERR(12, 84, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_6___iter__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_6___iter__.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_6___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_6___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_6___iter__ = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_6___iter__;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_7_iterchunks) < 0) __PYX_ERR(12, 250, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_7_iterchunks.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_7_iterchunks.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_7_iterchunks.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_7_iterchunks.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_7_iterchunks = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_7_iterchunks;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_8_itercolumns) < 0) __PYX_ERR(12, 1385, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_8_itercolumns.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_8_itercolumns.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_8_itercolumns.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_8_itercolumns.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_8_itercolumns = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_8_itercolumns;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_9_download) < 0) __PYX_ERR(6, 429, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_9_download.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_9_download.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_9_download.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_9_download.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_9_download = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_9_download;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_10_upload) < 0) __PYX_ERR(6, 517, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_10_upload.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_10_upload.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_10_upload.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_10_upload.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_10_upload = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_10_upload;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_11___iter__) < 0) __PYX_ERR(7, 129, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_11___iter__.tp_print = 0;
  #endif
  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___iter__) < 0) __PYX_ERR(7, 264, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_12___iter__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_12___iter__.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_12___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_12___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_12___iter__ = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_12___iter__;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_13_is_named_tuple) < 0) __PYX_ERR(14, 25, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_13_is_named_tuple.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_13_is_named_tuple.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_13_is_named_tuple.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_13_is_named_tuple.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_13_is_named_tuple = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_13_is_named_tuple;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_14_genexpr) < 0) __PYX_ERR(14, 33, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_14_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_14_genexpr.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_14_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_14_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_14_genexpr = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_14_genexpr;
  __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(18, 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(18, 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(19, 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(19, 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(20, 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(20, 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, int allow_none) {
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
            result = PyDict_SetItemString(moddict, to_name, value);
        }
        Py_DECREF(value);
    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    } else {
        result = -1;
    }
    return result;
}
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    if (__Pyx_check_single_interpreter())
        return NULL;
    if (__pyx_m)
        return __Pyx_NewRef(__pyx_m);
    modname = PyObject_GetAttrString(spec, "name");
    if (unlikely(!modname)) goto bad;
    module = PyModule_NewObject(modname);
    Py_DECREF(modname);
    if (unlikely(!module)) goto bad;
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
    return module;
bad:
    Py_XDECREF(module);
    return NULL;
}


static CYTHON_SMALL_CODE int __pyx_pymod_exec_lib(PyObject *__pyx_pyinit_module)
#endif
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m) {
    if (__pyx_m == __pyx_pyinit_module) return 0;
    PyErr_SetString(PyExc_RuntimeError, "Module 'lib' has already been imported. Re-initialisation is not supported.");
    return -1;
  }
  #elif PY_MAJOR_VERSION >= 3
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  #if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
if (!__Pyx_RefNanny) {
  PyErr_Clear();
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  if (!__Pyx_RefNanny)
      Py_FatalError("failed to import 'refnanny' module");
}
#endif
  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_lib(void)", 0);
  if (__Pyx_check_binary_version() < 0) __PYX_ERR(8, 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(8, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(8, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(8, 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(8, 1, __pyx_L1_error)
  #endif
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(8, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(8, 1, __pyx_L1_error)
  Py_INCREF(__pyx_b);
  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(8, 1, __pyx_L1_error)
  Py_INCREF(__pyx_cython_runtime);
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(8, 1, __pyx_L1_error);
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(8, 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(8, 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(8, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(8, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "pyarrow.lib")) {
      if (unlikely(PyDict_SetItemString(modules, "pyarrow.lib", __pyx_m) < 0)) __PYX_ERR(8, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error;
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error;
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code();
  (void)__Pyx_modinit_variable_export_code();
  if (unlikely(__Pyx_modinit_function_export_code() != 0)) goto __pyx_L1_error;
  if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
  if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
  (void)__Pyx_modinit_variable_import_code();
  (void)__Pyx_modinit_function_import_code();
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  #endif

  /* "pyarrow/lib.pyx":22
 * # cython: embedsignature = True
 * 
 * from collections import OrderedDict             # <<<<<<<<<<<<<<
 * import datetime
 * import decimal as _pydecimal
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_OrderedDict);
  __Pyx_GIVEREF(__pyx_n_s_OrderedDict);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_OrderedDict);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 22, __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_OrderedDict); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_OrderedDict, __pyx_t_1) < 0) __PYX_ERR(8, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":23
 * 
 * from collections import OrderedDict
 * import datetime             # <<<<<<<<<<<<<<
 * import decimal as _pydecimal
 * import json
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_datetime, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime, __pyx_t_2) < 0) __PYX_ERR(8, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":24
 * from collections import OrderedDict
 * import datetime
 * import decimal as _pydecimal             # <<<<<<<<<<<<<<
 * import json
 * import multiprocessing
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_decimal, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pydecimal, __pyx_t_2) < 0) __PYX_ERR(8, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":25
 * import datetime
 * import decimal as _pydecimal
 * import json             # <<<<<<<<<<<<<<
 * import multiprocessing
 * import numpy as np
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_json, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_json, __pyx_t_2) < 0) __PYX_ERR(8, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":26
 * import decimal as _pydecimal
 * import json
 * import multiprocessing             # <<<<<<<<<<<<<<
 * import numpy as np
 * import os
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_multiprocessing, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_multiprocessing, __pyx_t_2) < 0) __PYX_ERR(8, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":27
 * import json
 * import multiprocessing
 * import numpy as np             # <<<<<<<<<<<<<<
 * import os
 * import six
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_2) < 0) __PYX_ERR(8, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":28
 * import multiprocessing
 * import numpy as np
 * import os             # <<<<<<<<<<<<<<
 * import six
 * from pyarrow.compat import frombytes, tobytes
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_os, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_2) < 0) __PYX_ERR(8, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":29
 * import numpy as np
 * import os
 * import six             # <<<<<<<<<<<<<<
 * from pyarrow.compat import frombytes, tobytes
 * 
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_six, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_six, __pyx_t_2) < 0) __PYX_ERR(8, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":30
 * import os
 * import six
 * from pyarrow.compat import frombytes, tobytes             # <<<<<<<<<<<<<<
 * 
 * from cython.operator cimport dereference as deref
 */
  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_frombytes);
  __Pyx_GIVEREF(__pyx_n_s_frombytes);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_frombytes);
  __Pyx_INCREF(__pyx_n_s_tobytes);
  __Pyx_GIVEREF(__pyx_n_s_tobytes);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_tobytes);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_pyarrow_compat, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_frombytes, __pyx_t_2) < 0) __PYX_ERR(8, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tobytes, __pyx_t_2) < 0) __PYX_ERR(8, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":38
 * 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(8, 38, __pyx_L1_error)

  /* "pyarrow/lib.pyx":39
 * 
 * arrow_init_numpy()
 * set_numpy_nan(np.nan)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nan); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  arrow::py::set_numpy_nan(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":42
 * 
 * 
 * def cpu_count():             # <<<<<<<<<<<<<<
 *     """
 *     Return the number of threads to use in parallel operations.
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_1cpu_count, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cpu_count, __pyx_t_2) < 0) __PYX_ERR(8, 42, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":55
 * 
 * 
 * def set_cpu_count(int count):             # <<<<<<<<<<<<<<
 *     """
 *     Set the number of threads to use in parallel operations.
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_3set_cpu_count, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_cpu_count, __pyx_t_2) < 0) __PYX_ERR(8, 55, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":64
 * 
 * 
 * Type_NA = _Type_NA             # <<<<<<<<<<<<<<
 * Type_BOOL = _Type_BOOL
 * Type_UINT8 = _Type_UINT8
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::NA); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_NA, __pyx_t_2) < 0) __PYX_ERR(8, 64, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":65
 * 
 * Type_NA = _Type_NA
 * Type_BOOL = _Type_BOOL             # <<<<<<<<<<<<<<
 * Type_UINT8 = _Type_UINT8
 * Type_INT8 = _Type_INT8
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::BOOL); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_BOOL, __pyx_t_2) < 0) __PYX_ERR(8, 65, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":66
 * Type_NA = _Type_NA
 * Type_BOOL = _Type_BOOL
 * Type_UINT8 = _Type_UINT8             # <<<<<<<<<<<<<<
 * Type_INT8 = _Type_INT8
 * Type_UINT16 = _Type_UINT16
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT8); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_UINT8, __pyx_t_2) < 0) __PYX_ERR(8, 66, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":67
 * Type_BOOL = _Type_BOOL
 * Type_UINT8 = _Type_UINT8
 * Type_INT8 = _Type_INT8             # <<<<<<<<<<<<<<
 * Type_UINT16 = _Type_UINT16
 * Type_INT16 = _Type_INT16
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT8); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_INT8, __pyx_t_2) < 0) __PYX_ERR(8, 67, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":68
 * Type_UINT8 = _Type_UINT8
 * Type_INT8 = _Type_INT8
 * Type_UINT16 = _Type_UINT16             # <<<<<<<<<<<<<<
 * Type_INT16 = _Type_INT16
 * Type_UINT32 = _Type_UINT32
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT16); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_UINT16, __pyx_t_2) < 0) __PYX_ERR(8, 68, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":69
 * Type_INT8 = _Type_INT8
 * Type_UINT16 = _Type_UINT16
 * Type_INT16 = _Type_INT16             # <<<<<<<<<<<<<<
 * Type_UINT32 = _Type_UINT32
 * Type_INT32 = _Type_INT32
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT16); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_INT16, __pyx_t_2) < 0) __PYX_ERR(8, 69, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":70
 * Type_UINT16 = _Type_UINT16
 * Type_INT16 = _Type_INT16
 * Type_UINT32 = _Type_UINT32             # <<<<<<<<<<<<<<
 * Type_INT32 = _Type_INT32
 * Type_UINT64 = _Type_UINT64
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT32); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_UINT32, __pyx_t_2) < 0) __PYX_ERR(8, 70, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":71
 * Type_INT16 = _Type_INT16
 * Type_UINT32 = _Type_UINT32
 * Type_INT32 = _Type_INT32             # <<<<<<<<<<<<<<
 * Type_UINT64 = _Type_UINT64
 * Type_INT64 = _Type_INT64
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT32); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_INT32, __pyx_t_2) < 0) __PYX_ERR(8, 71, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":72
 * Type_UINT32 = _Type_UINT32
 * Type_INT32 = _Type_INT32
 * Type_UINT64 = _Type_UINT64             # <<<<<<<<<<<<<<
 * Type_INT64 = _Type_INT64
 * Type_HALF_FLOAT = _Type_HALF_FLOAT
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT64); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_UINT64, __pyx_t_2) < 0) __PYX_ERR(8, 72, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":73
 * Type_INT32 = _Type_INT32
 * Type_UINT64 = _Type_UINT64
 * Type_INT64 = _Type_INT64             # <<<<<<<<<<<<<<
 * Type_HALF_FLOAT = _Type_HALF_FLOAT
 * Type_FLOAT = _Type_FLOAT
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT64); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_INT64, __pyx_t_2) < 0) __PYX_ERR(8, 73, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":74
 * Type_UINT64 = _Type_UINT64
 * Type_INT64 = _Type_INT64
 * Type_HALF_FLOAT = _Type_HALF_FLOAT             # <<<<<<<<<<<<<<
 * Type_FLOAT = _Type_FLOAT
 * Type_DOUBLE = _Type_DOUBLE
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::HALF_FLOAT); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_HALF_FLOAT, __pyx_t_2) < 0) __PYX_ERR(8, 74, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":75
 * Type_INT64 = _Type_INT64
 * Type_HALF_FLOAT = _Type_HALF_FLOAT
 * Type_FLOAT = _Type_FLOAT             # <<<<<<<<<<<<<<
 * Type_DOUBLE = _Type_DOUBLE
 * Type_DECIMAL = _Type_DECIMAL
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::FLOAT); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_FLOAT, __pyx_t_2) < 0) __PYX_ERR(8, 75, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":76
 * Type_HALF_FLOAT = _Type_HALF_FLOAT
 * Type_FLOAT = _Type_FLOAT
 * Type_DOUBLE = _Type_DOUBLE             # <<<<<<<<<<<<<<
 * Type_DECIMAL = _Type_DECIMAL
 * Type_DATE32 = _Type_DATE32
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DOUBLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_DOUBLE, __pyx_t_2) < 0) __PYX_ERR(8, 76, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":77
 * Type_FLOAT = _Type_FLOAT
 * Type_DOUBLE = _Type_DOUBLE
 * Type_DECIMAL = _Type_DECIMAL             # <<<<<<<<<<<<<<
 * Type_DATE32 = _Type_DATE32
 * Type_DATE64 = _Type_DATE64
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DECIMAL); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_DECIMAL, __pyx_t_2) < 0) __PYX_ERR(8, 77, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":78
 * Type_DOUBLE = _Type_DOUBLE
 * Type_DECIMAL = _Type_DECIMAL
 * Type_DATE32 = _Type_DATE32             # <<<<<<<<<<<<<<
 * Type_DATE64 = _Type_DATE64
 * Type_TIMESTAMP = _Type_TIMESTAMP
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DATE32); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_DATE32, __pyx_t_2) < 0) __PYX_ERR(8, 78, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":79
 * Type_DECIMAL = _Type_DECIMAL
 * Type_DATE32 = _Type_DATE32
 * Type_DATE64 = _Type_DATE64             # <<<<<<<<<<<<<<
 * Type_TIMESTAMP = _Type_TIMESTAMP
 * Type_TIME32 = _Type_TIME32
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DATE64); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_DATE64, __pyx_t_2) < 0) __PYX_ERR(8, 79, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":80
 * Type_DATE32 = _Type_DATE32
 * Type_DATE64 = _Type_DATE64
 * Type_TIMESTAMP = _Type_TIMESTAMP             # <<<<<<<<<<<<<<
 * Type_TIME32 = _Type_TIME32
 * Type_TIME64 = _Type_TIME64
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIMESTAMP); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_TIMESTAMP, __pyx_t_2) < 0) __PYX_ERR(8, 80, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":81
 * Type_DATE64 = _Type_DATE64
 * Type_TIMESTAMP = _Type_TIMESTAMP
 * Type_TIME32 = _Type_TIME32             # <<<<<<<<<<<<<<
 * Type_TIME64 = _Type_TIME64
 * Type_BINARY = _Type_BINARY
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIME32); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_TIME32, __pyx_t_2) < 0) __PYX_ERR(8, 81, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":82
 * Type_TIMESTAMP = _Type_TIMESTAMP
 * Type_TIME32 = _Type_TIME32
 * Type_TIME64 = _Type_TIME64             # <<<<<<<<<<<<<<
 * Type_BINARY = _Type_BINARY
 * Type_STRING = _Type_STRING
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIME64); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_TIME64, __pyx_t_2) < 0) __PYX_ERR(8, 82, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":83
 * 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_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::BINARY); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_BINARY, __pyx_t_2) < 0) __PYX_ERR(8, 83, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":84
 * 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_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::STRING); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_STRING, __pyx_t_2) < 0) __PYX_ERR(8, 84, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":85
 * 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_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::FIXED_SIZE_BINARY); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_FIXED_SIZE_BINARY, __pyx_t_2) < 0) __PYX_ERR(8, 85, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":86
 * 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_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::LIST); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_LIST, __pyx_t_2) < 0) __PYX_ERR(8, 86, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":87
 * 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_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::STRUCT); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_STRUCT, __pyx_t_2) < 0) __PYX_ERR(8, 87, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":88
 * Type_LIST = _Type_LIST
 * Type_STRUCT = _Type_STRUCT
 * Type_UNION = _Type_UNION             # <<<<<<<<<<<<<<
 * Type_DICTIONARY = _Type_DICTIONARY
 * Type_MAP = _Type_MAP
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UNION); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_UNION, __pyx_t_2) < 0) __PYX_ERR(8, 88, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":89
 * Type_STRUCT = _Type_STRUCT
 * Type_UNION = _Type_UNION
 * Type_DICTIONARY = _Type_DICTIONARY             # <<<<<<<<<<<<<<
 * Type_MAP = _Type_MAP
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DICTIONARY); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_DICTIONARY, __pyx_t_2) < 0) __PYX_ERR(8, 89, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":90
 * Type_UNION = _Type_UNION
 * Type_DICTIONARY = _Type_DICTIONARY
 * Type_MAP = _Type_MAP             # <<<<<<<<<<<<<<
 * 
 * UnionMode_SPARSE = _UnionMode_SPARSE
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_MAP, __pyx_t_2) < 0) __PYX_ERR(8, 90, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":92
 * Type_MAP = _Type_MAP
 * 
 * UnionMode_SPARSE = _UnionMode_SPARSE             # <<<<<<<<<<<<<<
 * UnionMode_DENSE = _UnionMode_DENSE
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_UnionMode_3a__3a_type( arrow::UnionMode::SPARSE); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_UnionMode_SPARSE, __pyx_t_2) < 0) __PYX_ERR(8, 92, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":93
 * 
 * UnionMode_SPARSE = _UnionMode_SPARSE
 * UnionMode_DENSE = _UnionMode_DENSE             # <<<<<<<<<<<<<<
 * 
 * # pandas API shim
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_UnionMode_3a__3a_type( arrow::UnionMode::DENSE); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_UnionMode_DENSE, __pyx_t_2) < 0) __PYX_ERR(8, 93, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/pandas-shim.pxi":171
 * 
 * 
 * cdef _PandasAPIShim pandas_api = _PandasAPIShim()             # <<<<<<<<<<<<<<
 * _pandas_api = pandas_api
 */
  __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib__PandasAPIShim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_XGOTREF(((PyObject *)__pyx_v_7pyarrow_3lib_pandas_api));
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib_pandas_api, ((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_t_2));
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/pandas-shim.pxi":172
 * 
 * cdef _PandasAPIShim pandas_api = _PandasAPIShim()
 * _pandas_api = pandas_api             # <<<<<<<<<<<<<<
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pandas_api, ((PyObject *)__pyx_v_7pyarrow_3lib_pandas_api)) < 0) __PYX_ERR(3, 172, __pyx_L1_error)

  /* "pyarrow/error.pxi":20
 * from pyarrow.includes.libarrow cimport CStatus
 * from pyarrow.includes.common cimport c_string
 * from pyarrow.compat import frombytes             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_frombytes);
  __Pyx_GIVEREF(__pyx_n_s_frombytes);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_frombytes);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_pyarrow_compat, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_frombytes, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/error.pxi":23
 * 
 * 
 * class ArrowException(Exception):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  __Pyx_GIVEREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __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_2, __pyx_n_s_ArrowException, __pyx_t_1, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArrowException, __pyx_t_5) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/error.pxi":27
 * 
 * 
 * class ArrowInvalid(ValueError, ArrowException):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_builtin_ValueError);
  __Pyx_GIVEREF(__pyx_builtin_ValueError);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_ValueError);
  __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, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __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_1, __pyx_n_s_ArrowInvalid, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArrowInvalid, __pyx_t_5) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/error.pxi":31
 * 
 * 
 * class ArrowMemoryError(MemoryError, ArrowException):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_builtin_MemoryError);
  __Pyx_GIVEREF(__pyx_builtin_MemoryError);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_MemoryError);
  __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, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __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_2, __pyx_n_s_ArrowMemoryError, __pyx_t_1, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArrowMemoryError, __pyx_t_5) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/error.pxi":35
 * 
 * 
 * class ArrowIOError(IOError, ArrowException):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_builtin_IOError);
  __Pyx_GIVEREF(__pyx_builtin_IOError);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_IOError);
  __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, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __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_1, __pyx_n_s_ArrowIOError, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_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_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/error.pxi":39
 * 
 * 
 * class ArrowKeyError(KeyError, ArrowException):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_builtin_KeyError);
  __Pyx_GIVEREF(__pyx_builtin_KeyError);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_KeyError);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_ArrowKeyError, __pyx_n_s_ArrowKeyError, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_ArrowKeyError, __pyx_t_1, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 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_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/error.pxi":43
 * 
 * 
 * class ArrowTypeError(TypeError, ArrowException):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_builtin_TypeError);
  __Pyx_GIVEREF(__pyx_builtin_TypeError);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_TypeError);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_ArrowTypeError, __pyx_n_s_ArrowTypeError, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ArrowTypeError, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 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_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/error.pxi":47
 * 
 * 
 * class ArrowNotImplementedError(NotImplementedError, ArrowException):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_builtin_NotImplementedError);
  __Pyx_GIVEREF(__pyx_builtin_NotImplementedError);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_NotImplementedError);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_ArrowNotImplementedError, __pyx_n_s_ArrowNotImplementedError, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_ArrowNotImplementedError, __pyx_t_1, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 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_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/error.pxi":51
 * 
 * 
 * class ArrowCapacityError(ArrowException):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __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, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_ArrowCapacityError, __pyx_n_s_ArrowCapacityError, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ArrowCapacityError, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 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_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/error.pxi":55
 * 
 * 
 * class PlasmaObjectExists(ArrowException):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __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, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __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_2, __pyx_n_s_PlasmaObjectExists, __pyx_t_1, __pyx_t_4, NULL, 0, 0); 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_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/error.pxi":59
 * 
 * 
 * class PlasmaObjectNonexistent(ArrowException):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __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, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __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_1, __pyx_n_s_PlasmaObjectNonexistent, __pyx_t_2, __pyx_t_4, NULL, 0, 0); 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_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/error.pxi":63
 * 
 * 
 * class PlasmaStoreFull(ArrowException):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __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, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __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_2, __pyx_n_s_PlasmaStoreFull, __pyx_t_1, __pyx_t_4, NULL, 0, 0); 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_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/error.pxi":67
 * 
 * 
 * class ArrowSerializationError(ArrowException):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __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, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_ArrowSerializationError, __pyx_n_s_ArrowSerializationError, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ArrowSerializationError, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 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_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/memory.pxi":90
 * 
 * 
 * def default_memory_pool():             # <<<<<<<<<<<<<<
 *     """
 *     Return the process-global memory pool.
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_5default_memory_pool, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_memory_pool, __pyx_t_2) < 0) __PYX_ERR(10, 90, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/memory.pxi":100
 * 
 * 
 * def proxy_memory_pool(MemoryPool parent):             # <<<<<<<<<<<<<<
 *     """
 *     Create and return a MemoryPool instance that redirects to the
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_7proxy_memory_pool, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_proxy_memory_pool, __pyx_t_2) < 0) __PYX_ERR(10, 100, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/memory.pxi":111
 * 
 * 
 * def logging_memory_pool(MemoryPool parent):             # <<<<<<<<<<<<<<
 *     """
 *     Create and return a MemoryPool instance that redirects to the
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_9logging_memory_pool, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_logging_memory_pool, __pyx_t_2) < 0) __PYX_ERR(10, 111, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/memory.pxi":123
 * 
 * 
 * def set_memory_pool(MemoryPool pool):             # <<<<<<<<<<<<<<
 *     c_set_default_memory_pool(pool.pool)
 * 
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_11set_memory_pool, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_memory_pool, __pyx_t_2) < 0) __PYX_ERR(10, 123, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/memory.pxi":127
 * 
 * 
 * cdef MemoryPool _default_memory_pool = default_memory_pool()             # <<<<<<<<<<<<<<
 * cdef LoggingMemoryPool _logging_memory_pool = logging_memory_pool(
 *     _default_memory_pool)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_default_memory_pool); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_MemoryPool))))) __PYX_ERR(10, 127, __pyx_L1_error)
  __Pyx_XGOTREF(((PyObject *)__pyx_v_7pyarrow_3lib__default_memory_pool));
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib__default_memory_pool, ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_t_1));
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/memory.pxi":128
 * 
 * cdef MemoryPool _default_memory_pool = default_memory_pool()
 * cdef LoggingMemoryPool _logging_memory_pool = logging_memory_pool(             # <<<<<<<<<<<<<<
 *     _default_memory_pool)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_logging_memory_pool); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/memory.pxi":129
 * cdef MemoryPool _default_memory_pool = default_memory_pool()
 * cdef LoggingMemoryPool _logging_memory_pool = logging_memory_pool(
 *     _default_memory_pool)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_7pyarrow_3lib__default_memory_pool)); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/memory.pxi":128
 * 
 * cdef MemoryPool _default_memory_pool = default_memory_pool()
 * cdef LoggingMemoryPool _logging_memory_pool = logging_memory_pool(             # <<<<<<<<<<<<<<
 *     _default_memory_pool)
 * 
 */
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7pyarrow_3lib_LoggingMemoryPool))))) __PYX_ERR(10, 128, __pyx_L1_error)
  __Pyx_XGOTREF(((PyObject *)__pyx_v_7pyarrow_3lib__logging_memory_pool));
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib__logging_memory_pool, ((struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *)__pyx_t_2));
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/memory.pxi":132
 * 
 * 
 * def log_memory_allocations(enable=True):             # <<<<<<<<<<<<<<
 *     """
 *     Enable or disable memory allocator logging for debugging purposes
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_13log_memory_allocations, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_log_memory_allocations, __pyx_t_2) < 0) __PYX_ERR(10, 132, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/memory.pxi":147
 * 
 * 
 * def total_allocated_bytes():             # <<<<<<<<<<<<<<
 *     """
 *     Return the currently allocated bytes from the default memory pool.
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_15total_allocated_bytes, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_total_allocated_bytes, __pyx_t_2) < 0) __PYX_ERR(10, 147, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":18
 * # under the License.
 * 
 * import collections             # <<<<<<<<<<<<<<
 * import re
 * import warnings
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_collections, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_2) < 0) __PYX_ERR(4, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":19
 * 
 * import collections
 * import re             # <<<<<<<<<<<<<<
 * import warnings
 * 
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_re, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_2) < 0) __PYX_ERR(4, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":20
 * import collections
 * import re
 * import warnings             # <<<<<<<<<<<<<<
 * 
 * # These are imprecise because the type (in pandas 0.x) depends on the presence
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_2) < 0) __PYX_ERR(4, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":25
 * # of nulls
 * cdef dict _pandas_type_map = {
 *     _Type_NA: np.float64,  # NaNs             # <<<<<<<<<<<<<<
 *     _Type_BOOL: np.bool_,
 *     _Type_INT8: np.int8,
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(21); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::NA); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_5) < 0) __PYX_ERR(4, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":26
 * cdef dict _pandas_type_map = {
 *     _Type_NA: np.float64,  # NaNs
 *     _Type_BOOL: np.bool_,             # <<<<<<<<<<<<<<
 *     _Type_INT8: np.int8,
 *     _Type_INT16: np.int16,
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::BOOL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_bool); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_t_4) < 0) __PYX_ERR(4, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/types.pxi":27
 *     _Type_NA: np.float64,  # NaNs
 *     _Type_BOOL: np.bool_,
 *     _Type_INT8: np.int8,             # <<<<<<<<<<<<<<
 *     _Type_INT16: np.int16,
 *     _Type_INT32: np.int32,
 */
  __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT8); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int8); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_4, __pyx_t_1) < 0) __PYX_ERR(4, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":28
 *     _Type_BOOL: np.bool_,
 *     _Type_INT8: np.int8,
 *     _Type_INT16: np.int16,             # <<<<<<<<<<<<<<
 *     _Type_INT32: np.int32,
 *     _Type_INT64: np.int64,
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT16); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int16); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_5) < 0) __PYX_ERR(4, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":29
 *     _Type_INT8: np.int8,
 *     _Type_INT16: np.int16,
 *     _Type_INT32: np.int32,             # <<<<<<<<<<<<<<
 *     _Type_INT64: np.int64,
 *     _Type_UINT8: np.uint8,
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT32); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int32); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_t_4) < 0) __PYX_ERR(4, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/types.pxi":30
 *     _Type_INT16: np.int16,
 *     _Type_INT32: np.int32,
 *     _Type_INT64: np.int64,             # <<<<<<<<<<<<<<
 *     _Type_UINT8: np.uint8,
 *     _Type_UINT16: np.uint16,
 */
  __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT64); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_4, __pyx_t_1) < 0) __PYX_ERR(4, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":31
 *     _Type_INT32: np.int32,
 *     _Type_INT64: np.int64,
 *     _Type_UINT8: np.uint8,             # <<<<<<<<<<<<<<
 *     _Type_UINT16: np.uint16,
 *     _Type_UINT32: np.uint32,
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT8); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint8); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_5) < 0) __PYX_ERR(4, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":32
 *     _Type_INT64: np.int64,
 *     _Type_UINT8: np.uint8,
 *     _Type_UINT16: np.uint16,             # <<<<<<<<<<<<<<
 *     _Type_UINT32: np.uint32,
 *     _Type_UINT64: np.uint64,
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT16); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint16); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_t_4) < 0) __PYX_ERR(4, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/types.pxi":33
 *     _Type_UINT8: np.uint8,
 *     _Type_UINT16: np.uint16,
 *     _Type_UINT32: np.uint32,             # <<<<<<<<<<<<<<
 *     _Type_UINT64: np.uint64,
 *     _Type_HALF_FLOAT: np.float16,
 */
  __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT32); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint32); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_4, __pyx_t_1) < 0) __PYX_ERR(4, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":34
 *     _Type_UINT16: np.uint16,
 *     _Type_UINT32: np.uint32,
 *     _Type_UINT64: np.uint64,             # <<<<<<<<<<<<<<
 *     _Type_HALF_FLOAT: np.float16,
 *     _Type_FLOAT: np.float32,
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT64); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint64); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_5) < 0) __PYX_ERR(4, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":35
 *     _Type_UINT32: np.uint32,
 *     _Type_UINT64: np.uint64,
 *     _Type_HALF_FLOAT: np.float16,             # <<<<<<<<<<<<<<
 *     _Type_FLOAT: np.float32,
 *     _Type_DOUBLE: np.float64,
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::HALF_FLOAT); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float16); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_t_4) < 0) __PYX_ERR(4, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/types.pxi":36
 *     _Type_UINT64: np.uint64,
 *     _Type_HALF_FLOAT: np.float16,
 *     _Type_FLOAT: np.float32,             # <<<<<<<<<<<<<<
 *     _Type_DOUBLE: np.float64,
 *     _Type_DATE32: np.dtype('datetime64[ns]'),
 */
  __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_4, __pyx_t_1) < 0) __PYX_ERR(4, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":37
 *     _Type_HALF_FLOAT: np.float16,
 *     _Type_FLOAT: np.float32,
 *     _Type_DOUBLE: np.float64,             # <<<<<<<<<<<<<<
 *     _Type_DATE32: np.dtype('datetime64[ns]'),
 *     _Type_DATE64: np.dtype('datetime64[ns]'),
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DOUBLE); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_5) < 0) __PYX_ERR(4, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":38
 *     _Type_FLOAT: np.float32,
 *     _Type_DOUBLE: np.float64,
 *     _Type_DATE32: np.dtype('datetime64[ns]'),             # <<<<<<<<<<<<<<
 *     _Type_DATE64: np.dtype('datetime64[ns]'),
 *     _Type_TIMESTAMP: np.dtype('datetime64[ns]'),
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DATE32); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__249, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_t_1) < 0) __PYX_ERR(4, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":39
 *     _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_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DATE64); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 39, __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__249, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_5) < 0) __PYX_ERR(4, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":40
 *     _Type_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(4, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__249, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_t_1) < 0) __PYX_ERR(4, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":41
 *     _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_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::BINARY); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 41, __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(4, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_4) < 0) __PYX_ERR(4, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/types.pxi":42
 *     _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(4, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_4, __pyx_t_5) < 0) __PYX_ERR(4, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":43
 *     _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(4, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_t_1) < 0) __PYX_ERR(4, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":44
 *     _Type_FIXED_SIZE_BINARY: np.object_,
 *     _Type_STRING: np.object_,
 *     _Type_LIST: np.object_,             # <<<<<<<<<<<<<<
 *     _Type_DECIMAL: np.object_,
 * }
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::LIST); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_object_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_4) < 0) __PYX_ERR(4, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/types.pxi":45
 *     _Type_STRING: np.object_,
 *     _Type_LIST: np.object_,
 *     _Type_DECIMAL: np.object_,             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DECIMAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_4, __pyx_t_5) < 0) __PYX_ERR(4, 25, __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_2));
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":49
 * 
 * cdef dict _pep3118_type_map = {
 *     _Type_INT8: b'b',             # <<<<<<<<<<<<<<
 *     _Type_INT16: b'h',
 *     _Type_INT32: b'i',
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(11); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT8); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_n_b_b) < 0) __PYX_ERR(4, 49, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":50
 * 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(4, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_n_b_h) < 0) __PYX_ERR(4, 49, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":51
 *     _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(4, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_n_b_i) < 0) __PYX_ERR(4, 49, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":52
 *     _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(4, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_n_b_q) < 0) __PYX_ERR(4, 49, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":53
 *     _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(4, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_n_b_B) < 0) __PYX_ERR(4, 49, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":54
 *     _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(4, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_n_b_H) < 0) __PYX_ERR(4, 49, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":55
 *     _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(4, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_n_b_I) < 0) __PYX_ERR(4, 49, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":56
 *     _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(4, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_n_b_Q) < 0) __PYX_ERR(4, 49, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":57
 *     _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(4, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_n_b_e) < 0) __PYX_ERR(4, 49, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":58
 *     _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(4, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_n_b_f) < 0) __PYX_ERR(4, 49, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":59
 *     _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(4, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_n_b_d) < 0) __PYX_ERR(4, 49, __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_2));
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":80
 * 
 * 
 * def _is_primitive(Type type):             # <<<<<<<<<<<<<<
 *     # This is simply a redirect, the official API is in pyarrow.types.
 *     return is_primitive(type)
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_17_is_primitive, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_primitive, __pyx_t_2) < 0) __PYX_ERR(4, 80, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":720
 * 
 *     @classmethod
 *     def from_pandas(cls, df, bint preserve_index=True):             # <<<<<<<<<<<<<<
 *         """
 *         Returns implied schema from dataframe
 */
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_7pyarrow_3lib_Schema, __pyx_n_s_from_pandas); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 720, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pyarrow/types.pxi":719
 *                                            check_metadata)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_pandas(cls, df, bint preserve_index=True):
 *         """
 */
  __pyx_t_5 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Schema->tp_dict, __pyx_n_s_from_pandas, __pyx_t_5) < 0) __PYX_ERR(4, 720, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Schema);

  /* "pyarrow/types.pxi":954
 * 
 * 
 * cdef dict _type_cache = {}             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 954, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_XGOTREF(__pyx_v_7pyarrow_3lib__type_cache);
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib__type_cache, ((PyObject*)__pyx_t_5));
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":972
 * 
 * 
 * def field(name, type, bint nullable=True, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create a pyarrow.Field instance
 */
  __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_19field, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 972, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_field, __pyx_t_5) < 0) __PYX_ERR(4, 972, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":1008
 * 
 * cdef set PRIMITIVE_TYPES = set([
 *     _Type_NA, _Type_BOOL,             # <<<<<<<<<<<<<<
 *     _Type_UINT8, _Type_INT8,
 *     _Type_UINT16, _Type_INT16,
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::NA); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1008, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::BOOL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1008, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pyarrow/types.pxi":1009
 * cdef set PRIMITIVE_TYPES = set([
 *     _Type_NA, _Type_BOOL,
 *     _Type_UINT8, _Type_INT8,             # <<<<<<<<<<<<<<
 *     _Type_UINT16, _Type_INT16,
 *     _Type_UINT32, _Type_INT32,
 */
  __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT8); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1009, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT8); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1009, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/types.pxi":1010
 *     _Type_NA, _Type_BOOL,
 *     _Type_UINT8, _Type_INT8,
 *     _Type_UINT16, _Type_INT16,             # <<<<<<<<<<<<<<
 *     _Type_UINT32, _Type_INT32,
 *     _Type_UINT64, _Type_INT64,
 */
  __pyx_t_6 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT16); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1010, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT16); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 1010, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "pyarrow/types.pxi":1011
 *     _Type_UINT8, _Type_INT8,
 *     _Type_UINT16, _Type_INT16,
 *     _Type_UINT32, _Type_INT32,             # <<<<<<<<<<<<<<
 *     _Type_UINT64, _Type_INT64,
 *     _Type_TIMESTAMP, _Type_DATE32,
 */
  __pyx_t_8 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT32); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT32); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 1011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);

  /* "pyarrow/types.pxi":1012
 *     _Type_UINT16, _Type_INT16,
 *     _Type_UINT32, _Type_INT32,
 *     _Type_UINT64, _Type_INT64,             # <<<<<<<<<<<<<<
 *     _Type_TIMESTAMP, _Type_DATE32,
 *     _Type_TIME32, _Type_TIME64,
 */
  __pyx_t_10 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT64); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 1012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT64); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 1012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);

  /* "pyarrow/types.pxi":1013
 *     _Type_UINT32, _Type_INT32,
 *     _Type_UINT64, _Type_INT64,
 *     _Type_TIMESTAMP, _Type_DATE32,             # <<<<<<<<<<<<<<
 *     _Type_TIME32, _Type_TIME64,
 *     _Type_DATE64,
 */
  __pyx_t_12 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIMESTAMP); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 1013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DATE32); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 1013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);

  /* "pyarrow/types.pxi":1014
 *     _Type_UINT64, _Type_INT64,
 *     _Type_TIMESTAMP, _Type_DATE32,
 *     _Type_TIME32, _Type_TIME64,             # <<<<<<<<<<<<<<
 *     _Type_DATE64,
 *     _Type_HALF_FLOAT,
 */
  __pyx_t_14 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIME32); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 1014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_15 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIME64); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 1014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);

  /* "pyarrow/types.pxi":1015
 *     _Type_TIMESTAMP, _Type_DATE32,
 *     _Type_TIME32, _Type_TIME64,
 *     _Type_DATE64,             # <<<<<<<<<<<<<<
 *     _Type_HALF_FLOAT,
 *     _Type_FLOAT,
 */
  __pyx_t_16 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DATE64); if (unlikely(!__pyx_t_16)) __PYX_ERR(4, 1015, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);

  /* "pyarrow/types.pxi":1016
 *     _Type_TIME32, _Type_TIME64,
 *     _Type_DATE64,
 *     _Type_HALF_FLOAT,             # <<<<<<<<<<<<<<
 *     _Type_FLOAT,
 *     _Type_DOUBLE])
 */
  __pyx_t_17 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::HALF_FLOAT); if (unlikely(!__pyx_t_17)) __PYX_ERR(4, 1016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);

  /* "pyarrow/types.pxi":1017
 *     _Type_DATE64,
 *     _Type_HALF_FLOAT,
 *     _Type_FLOAT,             # <<<<<<<<<<<<<<
 *     _Type_DOUBLE])
 * 
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::FLOAT); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 1017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);

  /* "pyarrow/types.pxi":1018
 *     _Type_HALF_FLOAT,
 *     _Type_FLOAT,
 *     _Type_DOUBLE])             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DOUBLE); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_20 = PySet_New(0); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1007, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PySet_Add(__pyx_t_20, __pyx_t_5) < 0) __PYX_ERR(4, 1007, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_2) < 0) __PYX_ERR(4, 1007, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_4) < 0) __PYX_ERR(4, 1007, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_1) < 0) __PYX_ERR(4, 1007, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_6) < 0) __PYX_ERR(4, 1007, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_7) < 0) __PYX_ERR(4, 1007, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_8) < 0) __PYX_ERR(4, 1007, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_9) < 0) __PYX_ERR(4, 1007, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_10) < 0) __PYX_ERR(4, 1007, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_11) < 0) __PYX_ERR(4, 1007, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_12) < 0) __PYX_ERR(4, 1007, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_13) < 0) __PYX_ERR(4, 1007, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_14) < 0) __PYX_ERR(4, 1007, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_15) < 0) __PYX_ERR(4, 1007, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_16) < 0) __PYX_ERR(4, 1007, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_17) < 0) __PYX_ERR(4, 1007, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_18) < 0) __PYX_ERR(4, 1007, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_19) < 0) __PYX_ERR(4, 1007, __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":1021
 * 
 * 
 * def null():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of null type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_21null, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_null, __pyx_t_20) < 0) __PYX_ERR(4, 1021, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1028
 * 
 * 
 * def bool_():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of boolean type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_23bool_, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1028, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_bool, __pyx_t_20) < 0) __PYX_ERR(4, 1028, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1035
 * 
 * 
 * def uint8():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned int8 type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_25uint8, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1035, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_uint8, __pyx_t_20) < 0) __PYX_ERR(4, 1035, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1042
 * 
 * 
 * def int8():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int8 type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_27int8, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_int8, __pyx_t_20) < 0) __PYX_ERR(4, 1042, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1049
 * 
 * 
 * def uint16():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint16 type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_29uint16, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_uint16, __pyx_t_20) < 0) __PYX_ERR(4, 1049, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1056
 * 
 * 
 * def int16():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int16 type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_31int16, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1056, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_int16, __pyx_t_20) < 0) __PYX_ERR(4, 1056, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1063
 * 
 * 
 * def uint32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint32 type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_33uint32, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_uint32, __pyx_t_20) < 0) __PYX_ERR(4, 1063, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1070
 * 
 * 
 * def int32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int32 type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_35int32, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1070, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_int32, __pyx_t_20) < 0) __PYX_ERR(4, 1070, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1077
 * 
 * 
 * def uint64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint64 type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_37uint64, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1077, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_uint64, __pyx_t_20) < 0) __PYX_ERR(4, 1077, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1084
 * 
 * 
 * def int64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int64 type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_39int64, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1084, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_int64, __pyx_t_20) < 0) __PYX_ERR(4, 1084, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1091
 * 
 * 
 * cdef dict _timestamp_type_cache = {}             # <<<<<<<<<<<<<<
 * cdef dict _time_type_cache = {}
 * 
 */
  __pyx_t_20 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1091, __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":1092
 * 
 * cdef dict _timestamp_type_cache = {}
 * cdef dict _time_type_cache = {}             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_20 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1092, __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":1106
 * 
 * 
 * _FIXED_OFFSET_RE = re.compile(r'([+-])(0[0-9]|1[0-9]|2[0-3]):([0-5][0-9])$')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_n_s_re); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_compile); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1106, __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__264, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FIXED_OFFSET_RE, __pyx_t_20) < 0) __PYX_ERR(4, 1106, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1109
 * 
 * 
 * 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_41tzinfo_to_string, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tzinfo_to_string, __pyx_t_20) < 0) __PYX_ERR(4, 1109, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1155
 * 
 * 
 * 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_43string_to_tzinfo, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_string_to_tzinfo, __pyx_t_20) < 0) __PYX_ERR(4, 1155, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1183
 * 
 * 
 * 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_45timestamp, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_timestamp, __pyx_t_20) < 0) __PYX_ERR(4, 1183, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1238
 * 
 * 
 * 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_47time32, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_time32, __pyx_t_20) < 0) __PYX_ERR(4, 1238, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1276
 * 
 * 
 * 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_49time64, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_time64, __pyx_t_20) < 0) __PYX_ERR(4, 1276, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1314
 * 
 * 
 * def date32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 32-bit date (days since UNIX epoch 1970-01-01)
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_51date32, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_date32, __pyx_t_20) < 0) __PYX_ERR(4, 1314, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1321
 * 
 * 
 * def date64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 64-bit date (milliseconds since UNIX epoch 1970-01-01)
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_53date64, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_date64, __pyx_t_20) < 0) __PYX_ERR(4, 1321, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1328
 * 
 * 
 * def float16():             # <<<<<<<<<<<<<<
 *     """
 *     Create half-precision floating point type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_55float16, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_float16, __pyx_t_20) < 0) __PYX_ERR(4, 1328, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1335
 * 
 * 
 * def float32():             # <<<<<<<<<<<<<<
 *     """
 *     Create single-precision floating point type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_57float32, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_float32, __pyx_t_20) < 0) __PYX_ERR(4, 1335, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1342
 * 
 * 
 * def float64():             # <<<<<<<<<<<<<<
 *     """
 *     Create double-precision floating point type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_59float64, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_float64, __pyx_t_20) < 0) __PYX_ERR(4, 1342, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1369
 * 
 * 
 * def string():             # <<<<<<<<<<<<<<
 *     """
 *     Create UTF8 variable-length string type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_63string, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_string, __pyx_t_20) < 0) __PYX_ERR(4, 1369, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1376
 * 
 * 
 * def utf8():             # <<<<<<<<<<<<<<
 *     """
 *     Alias for string()
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_65utf8, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_utf8, __pyx_t_20) < 0) __PYX_ERR(4, 1376, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1383
 * 
 * 
 * def binary(int length=-1):             # <<<<<<<<<<<<<<
 *     """
 *     Create variable-length binary type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_67binary, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_binary, __pyx_t_20) < 0) __PYX_ERR(4, 1383, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1455
 * 
 * 
 * def struct(fields):             # <<<<<<<<<<<<<<
 *     """
 *     Create StructType instance from fields
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_73struct, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_struct, __pyx_t_20) < 0) __PYX_ERR(4, 1455, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1503
 * 
 * 
 * def union(children_fields, mode):             # <<<<<<<<<<<<<<
 *     """
 *     Create UnionType from children fields.
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_75union, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_union, __pyx_t_20) < 0) __PYX_ERR(4, 1503, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1550
 * 
 * cdef dict _type_aliases = {
 *     'null': null,             # <<<<<<<<<<<<<<
 *     'bool': bool_,
 *     'boolean': bool_,
 */
  __pyx_t_20 = __Pyx_PyDict_NewPresized(44); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_null); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_null, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1551
 * cdef dict _type_aliases = {
 *     'null': null,
 *     'bool': bool_,             # <<<<<<<<<<<<<<
 *     'boolean': bool_,
 *     'i1': int8,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_bool); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1551, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_bool_2, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1552
 *     'null': null,
 *     'bool': bool_,
 *     'boolean': bool_,             # <<<<<<<<<<<<<<
 *     'i1': int8,
 *     'int8': int8,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_bool); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_boolean, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1553
 *     'bool': bool_,
 *     'boolean': bool_,
 *     'i1': int8,             # <<<<<<<<<<<<<<
 *     'int8': int8,
 *     'i2': int16,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_int8); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_i1, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1554
 *     'boolean': bool_,
 *     'i1': int8,
 *     'int8': int8,             # <<<<<<<<<<<<<<
 *     'i2': int16,
 *     'int16': int16,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_int8); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_int8, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1555
 *     'i1': int8,
 *     'int8': int8,
 *     'i2': int16,             # <<<<<<<<<<<<<<
 *     'int16': int16,
 *     'i4': int32,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_int16); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_i2, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1556
 *     'int8': int8,
 *     'i2': int16,
 *     'int16': int16,             # <<<<<<<<<<<<<<
 *     'i4': int32,
 *     'int32': int32,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_int16); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_int16, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1557
 *     'i2': int16,
 *     'int16': int16,
 *     'i4': int32,             # <<<<<<<<<<<<<<
 *     'int32': int32,
 *     'i8': int64,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_int32); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_i4, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1558
 *     'int16': int16,
 *     'i4': int32,
 *     'int32': int32,             # <<<<<<<<<<<<<<
 *     'i8': int64,
 *     'int64': int64,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_int32); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_int32, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1559
 *     'i4': int32,
 *     'int32': int32,
 *     'i8': int64,             # <<<<<<<<<<<<<<
 *     'int64': int64,
 *     'u1': uint8,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_int64); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_i8, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1560
 *     'int32': int32,
 *     'i8': int64,
 *     'int64': int64,             # <<<<<<<<<<<<<<
 *     'u1': uint8,
 *     'uint8': uint8,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_int64); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_int64, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1561
 *     'i8': int64,
 *     'int64': int64,
 *     'u1': uint8,             # <<<<<<<<<<<<<<
 *     'uint8': uint8,
 *     'u2': uint16,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_uint8); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_u1, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1562
 *     'int64': int64,
 *     'u1': uint8,
 *     'uint8': uint8,             # <<<<<<<<<<<<<<
 *     'u2': uint16,
 *     'uint16': uint16,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_uint8); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_uint8, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1563
 *     'u1': uint8,
 *     'uint8': uint8,
 *     'u2': uint16,             # <<<<<<<<<<<<<<
 *     'uint16': uint16,
 *     'u4': uint32,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_uint16); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_u2, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1564
 *     'uint8': uint8,
 *     'u2': uint16,
 *     'uint16': uint16,             # <<<<<<<<<<<<<<
 *     'u4': uint32,
 *     'uint32': uint32,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_uint16); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_uint16, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1565
 *     'u2': uint16,
 *     'uint16': uint16,
 *     'u4': uint32,             # <<<<<<<<<<<<<<
 *     'uint32': uint32,
 *     'u8': uint64,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_uint32); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_u4, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1566
 *     'uint16': uint16,
 *     'u4': uint32,
 *     'uint32': uint32,             # <<<<<<<<<<<<<<
 *     'u8': uint64,
 *     'uint64': uint64,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_uint32); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_uint32, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1567
 *     'u4': uint32,
 *     'uint32': uint32,
 *     'u8': uint64,             # <<<<<<<<<<<<<<
 *     'uint64': uint64,
 *     'f2': float16,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_uint64); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_u8, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1568
 *     'uint32': uint32,
 *     'u8': uint64,
 *     'uint64': uint64,             # <<<<<<<<<<<<<<
 *     'f2': float16,
 *     'halffloat': float16,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_uint64); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_uint64, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1569
 *     'u8': uint64,
 *     'uint64': uint64,
 *     'f2': float16,             # <<<<<<<<<<<<<<
 *     'halffloat': float16,
 *     'float16': float16,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_float16); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_f2, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1570
 *     'uint64': uint64,
 *     'f2': float16,
 *     'halffloat': float16,             # <<<<<<<<<<<<<<
 *     'float16': float16,
 *     'f4': float32,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_float16); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_halffloat, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1571
 *     'f2': float16,
 *     'halffloat': float16,
 *     'float16': float16,             # <<<<<<<<<<<<<<
 *     'f4': float32,
 *     'float': float32,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_float16); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_float16, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1572
 *     'halffloat': float16,
 *     'float16': float16,
 *     'f4': float32,             # <<<<<<<<<<<<<<
 *     'float': float32,
 *     'float32': float32,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_float32); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_f4, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1573
 *     'float16': float16,
 *     'f4': float32,
 *     'float': float32,             # <<<<<<<<<<<<<<
 *     'float32': float32,
 *     'f8': float64,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_float32); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_float, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1574
 *     'f4': float32,
 *     'float': float32,
 *     'float32': float32,             # <<<<<<<<<<<<<<
 *     'f8': float64,
 *     'double': float64,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_float32); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_float32, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1575
 *     'float': float32,
 *     'float32': float32,
 *     'f8': float64,             # <<<<<<<<<<<<<<
 *     'double': float64,
 *     'float64': float64,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_float64); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1575, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_f8, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1576
 *     'float32': float32,
 *     'f8': float64,
 *     'double': float64,             # <<<<<<<<<<<<<<
 *     'float64': float64,
 *     'string': string,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_float64); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_double, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1577
 *     'f8': float64,
 *     'double': float64,
 *     'float64': float64,             # <<<<<<<<<<<<<<
 *     'string': string,
 *     'str': string,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_float64); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_float64, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1578
 *     'double': float64,
 *     'float64': float64,
 *     'string': string,             # <<<<<<<<<<<<<<
 *     'str': string,
 *     'utf8': string,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_string); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_string, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1579
 *     'float64': float64,
 *     'string': string,
 *     'str': string,             # <<<<<<<<<<<<<<
 *     'utf8': string,
 *     'binary': binary,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_string); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_str_2, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1580
 *     '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(4, 1580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_utf8, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1581
 *     '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(4, 1581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_binary, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1582
 *     '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(4, 1582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_date32, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1583
 *     '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(4, 1583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_date64, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1584
 *     'date32': date32,
 *     'date64': date64,
 *     'date32[day]': date32,             # <<<<<<<<<<<<<<
 *     'date64[ms]': date64,
 *     'time32[s]': time32('s'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_date32); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_date32_day, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1585
 *     'date64': date64,
 *     'date32[day]': date32,
 *     'date64[ms]': date64,             # <<<<<<<<<<<<<<
 *     'time32[s]': time32('s'),
 *     'time32[ms]': time32('ms'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_date64); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_date64_ms, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1586
 *     'date32[day]': date32,
 *     'date64[ms]': date64,
 *     'time32[s]': time32('s'),             # <<<<<<<<<<<<<<
 *     'time32[ms]': time32('ms'),
 *     'time64[us]': time64('us'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_time32); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_tuple__288, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 1586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_time32_s, __pyx_t_18) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/types.pxi":1587
 *     'date64[ms]': date64,
 *     'time32[s]': time32('s'),
 *     'time32[ms]': time32('ms'),             # <<<<<<<<<<<<<<
 *     'time64[us]': time64('us'),
 *     'time64[ns]': time64('ns'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_time32); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 1587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_tuple__289, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_time32_ms, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1588
 *     'time32[s]': time32('s'),
 *     'time32[ms]': time32('ms'),
 *     'time64[us]': time64('us'),             # <<<<<<<<<<<<<<
 *     'time64[ns]': time64('ns'),
 *     'timestamp[s]': timestamp('s'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_time64); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_tuple__290, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 1588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_time64_us, __pyx_t_18) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/types.pxi":1589
 *     'time32[ms]': time32('ms'),
 *     'time64[us]': time64('us'),
 *     'time64[ns]': time64('ns'),             # <<<<<<<<<<<<<<
 *     'timestamp[s]': timestamp('s'),
 *     'timestamp[ms]': timestamp('ms'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_time64); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 1589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_tuple__291, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_time64_ns, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1590
 *     'time64[us]': time64('us'),
 *     'time64[ns]': time64('ns'),
 *     'timestamp[s]': timestamp('s'),             # <<<<<<<<<<<<<<
 *     'timestamp[ms]': timestamp('ms'),
 *     'timestamp[us]': timestamp('us'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_timestamp); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_tuple__288, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 1590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_timestamp_s, __pyx_t_18) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/types.pxi":1591
 *     'time64[ns]': time64('ns'),
 *     'timestamp[s]': timestamp('s'),
 *     'timestamp[ms]': timestamp('ms'),             # <<<<<<<<<<<<<<
 *     'timestamp[us]': timestamp('us'),
 *     'timestamp[ns]': timestamp('ns'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_timestamp); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 1591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_tuple__289, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_timestamp_ms, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1592
 *     '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(4, 1592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_tuple__290, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 1592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_timestamp_us, __pyx_t_18) < 0) __PYX_ERR(4, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/types.pxi":1593
 *     'timestamp[ms]': timestamp('ms'),
 *     'timestamp[us]': timestamp('us'),
 *     'timestamp[ns]': timestamp('ns'),             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_timestamp); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 1593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_tuple__291, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_timestamp_ns, __pyx_t_19) < 0) __PYX_ERR(4, 1550, __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":1597
 * 
 * 
 * def type_for_alias(name):             # <<<<<<<<<<<<<<
 *     """
 *     Return DataType given a string alias if one exists
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_77type_for_alias, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_type_for_alias, __pyx_t_20) < 0) __PYX_ERR(4, 1597, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1627
 * 
 * 
 * def schema(fields, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct pyarrow.Schema from collection of fields
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_79schema, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_schema, __pyx_t_20) < 0) __PYX_ERR(4, 1627, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1683
 * 
 * 
 * def from_numpy_dtype(object dtype):             # <<<<<<<<<<<<<<
 *     """
 *     Convert NumPy dtype to pyarrow.DataType
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_81from_numpy_dtype, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_from_numpy_dtype, __pyx_t_20) < 0) __PYX_ERR(4, 1683, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1695
 * 
 * 
 * def is_boolean_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyBool(obj)
 * 
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_83is_boolean_value, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_boolean_value, __pyx_t_20) < 0) __PYX_ERR(4, 1695, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1699
 * 
 * 
 * def is_integer_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyInt(obj)
 * 
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_85is_integer_value, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_integer_value, __pyx_t_20) < 0) __PYX_ERR(4, 1699, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1703
 * 
 * 
 * def is_float_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyFloat(obj)
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_87is_float_value, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_float_value, __pyx_t_20) < 0) __PYX_ERR(4, 1703, __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(5, 19, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NA, Py_None) < 0) __PYX_ERR(5, 19, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":50
 * 
 * 
 * _NULL = NA = NullType()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_20 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_NullType)); if (unlikely(!__pyx_t_20)) __PYX_ERR(5, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NULL_2, __pyx_t_20) < 0) __PYX_ERR(5, 50, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NA, __pyx_t_20) < 0) __PYX_ERR(5, 50, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/scalar.pxi":287
 * 
 * 
 * cdef dict _DATETIME_CONVERSION_FUNCTIONS = {}             # <<<<<<<<<<<<<<
 * cdef c_bool _datetime_conversion_initialized = False
 * 
 */
  __pyx_t_20 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_20)) __PYX_ERR(5, 287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __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;

  /* "pyarrow/scalar.pxi":288
 * 
 * cdef dict _DATETIME_CONVERSION_FUNCTIONS = {}
 * cdef c_bool _datetime_conversion_initialized = False             # <<<<<<<<<<<<<<
 * 
 * cdef _datetime_conversion_functions():
 */
  __pyx_v_7pyarrow_3lib__datetime_conversion_initialized = 0;

  /* "pyarrow/scalar.pxi":638
 * 
 * cdef dict _array_value_classes = {
 *     _Type_BOOL: BooleanValue,             # <<<<<<<<<<<<<<
 *     _Type_UINT8: UInt8Value,
 *     _Type_UINT16: UInt16Value,
 */
  __pyx_t_20 = __Pyx_PyDict_NewPresized(25); if (unlikely(!__pyx_t_20)) __PYX_ERR(5, 638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::BOOL); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_BooleanValue)) < 0) __PYX_ERR(5, 638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":639
 * cdef dict _array_value_classes = {
 *     _Type_BOOL: BooleanValue,
 *     _Type_UINT8: UInt8Value,             # <<<<<<<<<<<<<<
 *     _Type_UINT16: UInt16Value,
 *     _Type_UINT32: UInt32Value,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT8); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt8Value)) < 0) __PYX_ERR(5, 638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":640
 *     _Type_BOOL: BooleanValue,
 *     _Type_UINT8: UInt8Value,
 *     _Type_UINT16: UInt16Value,             # <<<<<<<<<<<<<<
 *     _Type_UINT32: UInt32Value,
 *     _Type_UINT64: UInt64Value,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT16); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt16Value)) < 0) __PYX_ERR(5, 638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":641
 *     _Type_UINT8: UInt8Value,
 *     _Type_UINT16: UInt16Value,
 *     _Type_UINT32: UInt32Value,             # <<<<<<<<<<<<<<
 *     _Type_UINT64: UInt64Value,
 *     _Type_INT8: Int8Value,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT32); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt32Value)) < 0) __PYX_ERR(5, 638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":642
 *     _Type_UINT16: UInt16Value,
 *     _Type_UINT32: UInt32Value,
 *     _Type_UINT64: UInt64Value,             # <<<<<<<<<<<<<<
 *     _Type_INT8: Int8Value,
 *     _Type_INT16: Int16Value,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT64); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt64Value)) < 0) __PYX_ERR(5, 638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":643
 *     _Type_UINT32: UInt32Value,
 *     _Type_UINT64: UInt64Value,
 *     _Type_INT8: Int8Value,             # <<<<<<<<<<<<<<
 *     _Type_INT16: Int16Value,
 *     _Type_INT32: Int32Value,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT8); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int8Value)) < 0) __PYX_ERR(5, 638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":644
 *     _Type_UINT64: UInt64Value,
 *     _Type_INT8: Int8Value,
 *     _Type_INT16: Int16Value,             # <<<<<<<<<<<<<<
 *     _Type_INT32: Int32Value,
 *     _Type_INT64: Int64Value,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT16); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int16Value)) < 0) __PYX_ERR(5, 638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":645
 *     _Type_INT8: Int8Value,
 *     _Type_INT16: Int16Value,
 *     _Type_INT32: Int32Value,             # <<<<<<<<<<<<<<
 *     _Type_INT64: Int64Value,
 *     _Type_DATE32: Date32Value,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT32); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int32Value)) < 0) __PYX_ERR(5, 638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":646
 *     _Type_INT16: Int16Value,
 *     _Type_INT32: Int32Value,
 *     _Type_INT64: Int64Value,             # <<<<<<<<<<<<<<
 *     _Type_DATE32: Date32Value,
 *     _Type_DATE64: Date64Value,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT64); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int64Value)) < 0) __PYX_ERR(5, 638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":647
 *     _Type_INT32: Int32Value,
 *     _Type_INT64: Int64Value,
 *     _Type_DATE32: Date32Value,             # <<<<<<<<<<<<<<
 *     _Type_DATE64: Date64Value,
 *     _Type_TIME32: Time32Value,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DATE32); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Date32Value)) < 0) __PYX_ERR(5, 638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":648
 *     _Type_INT64: Int64Value,
 *     _Type_DATE32: Date32Value,
 *     _Type_DATE64: Date64Value,             # <<<<<<<<<<<<<<
 *     _Type_TIME32: Time32Value,
 *     _Type_TIME64: Time64Value,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DATE64); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Date64Value)) < 0) __PYX_ERR(5, 638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":649
 *     _Type_DATE32: Date32Value,
 *     _Type_DATE64: Date64Value,
 *     _Type_TIME32: Time32Value,             # <<<<<<<<<<<<<<
 *     _Type_TIME64: Time64Value,
 *     _Type_TIMESTAMP: TimestampValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIME32); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Time32Value)) < 0) __PYX_ERR(5, 638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":650
 *     _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(5, 650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Time64Value)) < 0) __PYX_ERR(5, 638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":651
 *     _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(5, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_TimestampValue)) < 0) __PYX_ERR(5, 638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":652
 *     _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(5, 652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_HalfFloatValue)) < 0) __PYX_ERR(5, 638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":653
 *     _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(5, 653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_FloatValue)) < 0) __PYX_ERR(5, 638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":654
 *     _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(5, 654, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_DoubleValue)) < 0) __PYX_ERR(5, 638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":655
 *     _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(5, 655, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_ListValue)) < 0) __PYX_ERR(5, 638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":656
 *     _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(5, 656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UnionValue)) < 0) __PYX_ERR(5, 638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":657
 *     _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(5, 657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_BinaryValue)) < 0) __PYX_ERR(5, 638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":658
 *     _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(5, 658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_StringValue)) < 0) __PYX_ERR(5, 638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":659
 *     _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(5, 659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryValue)) < 0) __PYX_ERR(5, 638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":660
 *     _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(5, 660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_DecimalValue)) < 0) __PYX_ERR(5, 638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":661
 *     _Type_FIXED_SIZE_BINARY: FixedSizeBinaryValue,
 *     _Type_DECIMAL: DecimalValue,
 *     _Type_STRUCT: StructValue,             # <<<<<<<<<<<<<<
 *     _Type_DICTIONARY: DictionaryValue,
 * }
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::STRUCT); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_StructValue)) < 0) __PYX_ERR(5, 638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":662
 *     _Type_DECIMAL: DecimalValue,
 *     _Type_STRUCT: StructValue,
 *     _Type_DICTIONARY: DictionaryValue,             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DICTIONARY); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_DictionaryValue)) < 0) __PYX_ERR(5, 638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_XGOTREF(__pyx_v_7pyarrow_3lib__array_value_classes);
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib__array_value_classes, ((PyObject*)__pyx_t_20));
  __Pyx_GIVEREF(__pyx_t_20);
  __pyx_t_20 = 0;

  /* "pyarrow/scalar.pxi":832
 * 
 * cdef dict _scalar_classes = {
 *     _Type_UINT8: UInt8Scalar,             # <<<<<<<<<<<<<<
 *     _Type_UINT16: UInt16Scalar,
 *     _Type_UINT32: UInt32Scalar,
 */
  __pyx_t_20 = __Pyx_PyDict_NewPresized(10); if (unlikely(!__pyx_t_20)) __PYX_ERR(5, 832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT8); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt8Scalar)) < 0) __PYX_ERR(5, 832, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":833
 * cdef dict _scalar_classes = {
 *     _Type_UINT8: UInt8Scalar,
 *     _Type_UINT16: UInt16Scalar,             # <<<<<<<<<<<<<<
 *     _Type_UINT32: UInt32Scalar,
 *     _Type_UINT64: UInt64Scalar,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT16); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt16Scalar)) < 0) __PYX_ERR(5, 832, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":834
 *     _Type_UINT8: UInt8Scalar,
 *     _Type_UINT16: UInt16Scalar,
 *     _Type_UINT32: UInt32Scalar,             # <<<<<<<<<<<<<<
 *     _Type_UINT64: UInt64Scalar,
 *     _Type_INT8: Int8Scalar,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT32); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 834, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt32Scalar)) < 0) __PYX_ERR(5, 832, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":835
 *     _Type_UINT16: UInt16Scalar,
 *     _Type_UINT32: UInt32Scalar,
 *     _Type_UINT64: UInt64Scalar,             # <<<<<<<<<<<<<<
 *     _Type_INT8: Int8Scalar,
 *     _Type_INT16: Int16Scalar,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT64); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt64Scalar)) < 0) __PYX_ERR(5, 832, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":836
 *     _Type_UINT32: UInt32Scalar,
 *     _Type_UINT64: UInt64Scalar,
 *     _Type_INT8: Int8Scalar,             # <<<<<<<<<<<<<<
 *     _Type_INT16: Int16Scalar,
 *     _Type_INT32: Int32Scalar,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT8); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int8Scalar)) < 0) __PYX_ERR(5, 832, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":837
 *     _Type_UINT64: UInt64Scalar,
 *     _Type_INT8: Int8Scalar,
 *     _Type_INT16: Int16Scalar,             # <<<<<<<<<<<<<<
 *     _Type_INT32: Int32Scalar,
 *     _Type_INT64: Int64Scalar,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT16); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int16Scalar)) < 0) __PYX_ERR(5, 832, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":838
 *     _Type_INT8: Int8Scalar,
 *     _Type_INT16: Int16Scalar,
 *     _Type_INT32: Int32Scalar,             # <<<<<<<<<<<<<<
 *     _Type_INT64: Int64Scalar,
 *     _Type_FLOAT: FloatScalar,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT32); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int32Scalar)) < 0) __PYX_ERR(5, 832, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":839
 *     _Type_INT16: Int16Scalar,
 *     _Type_INT32: Int32Scalar,
 *     _Type_INT64: Int64Scalar,             # <<<<<<<<<<<<<<
 *     _Type_FLOAT: FloatScalar,
 *     _Type_DOUBLE: DoubleScalar,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT64); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int64Scalar)) < 0) __PYX_ERR(5, 832, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":840
 *     _Type_INT32: Int32Scalar,
 *     _Type_INT64: Int64Scalar,
 *     _Type_FLOAT: FloatScalar,             # <<<<<<<<<<<<<<
 *     _Type_DOUBLE: DoubleScalar,
 * }
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::FLOAT); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 840, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_FloatScalar)) < 0) __PYX_ERR(5, 832, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":841
 *     _Type_INT64: Int64Scalar,
 *     _Type_FLOAT: FloatScalar,
 *     _Type_DOUBLE: DoubleScalar,             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DOUBLE); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_DoubleScalar)) < 0) __PYX_ERR(5, 832, __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_20));
  __Pyx_GIVEREF(__pyx_t_20);
  __pyx_t_20 = 0;

  /* "pyarrow/array.pxi":50
 * 
 * 
 * def _ndarray_to_arrow_type(object values, DataType type):             # <<<<<<<<<<<<<<
 *     return pyarrow_wrap_data_type(_ndarray_to_type(values, type))
 * 
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_89_ndarray_to_arrow_type, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ndarray_to_arrow_type, __pyx_t_20) < 0) __PYX_ERR(1, 50, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 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_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_91array, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_array, __pyx_t_20) < 0) __PYX_ERR(1, 87, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/array.pxi":176
 * 
 * 
 * def asarray(values, type=None):             # <<<<<<<<<<<<<<
 *     """
 *     Convert to pyarrow.Array, inferring type if not provided. Attempt to cast
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_93asarray, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_asarray, __pyx_t_20) < 0) __PYX_ERR(1, 176, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/array.pxi":199
 * 
 * 
 * def _normalize_slice(object arrow_obj, slice key):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t start, stop, step
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_95_normalize_slice, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_normalize_slice, __pyx_t_20) < 0) __PYX_ERR(1, 199, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 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_20 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib__FunctionContext)); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __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_20));
  __Pyx_GIVEREF(__pyx_t_20);
  __pyx_t_20 = 0;

  /* "pyarrow/array.pxi":334
 * 
 * 
 * def _restore_array(data):             # <<<<<<<<<<<<<<
 *     """
 *     Reconstruct an Array from pickled ArrayData.
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_97_restore_array, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_restore_array, __pyx_t_20) < 0) __PYX_ERR(1, 334, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/array.pxi":510
 * 
 *     @staticmethod
 *     def from_pandas(obj, mask=None, type=None, bint safe=True,             # <<<<<<<<<<<<<<
 *                     MemoryPool memory_pool=None):
 *         """
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_5Array_15from_pandas, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Array->tp_dict, __pyx_n_s_from_pandas, __pyx_t_20) < 0) __PYX_ERR(1, 510, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Array);

  /* "pyarrow/array.pxi":509
 *         return wrap_datum(out)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_pandas(obj, mask=None, type=None, bint safe=True,
 *                     MemoryPool memory_pool=None):
 */
  __Pyx_GetNameInClass(__pyx_t_20, (PyObject *)__pyx_ptype_7pyarrow_3lib_Array, __pyx_n_s_from_pandas); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_20); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Array->tp_dict, __pyx_n_s_from_pandas, __pyx_t_19) < 0) __PYX_ERR(1, 510, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Array);

  /* "pyarrow/array.pxi":550
 * 
 *     @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_19from_buffers, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Array->tp_dict, __pyx_n_s_from_buffers, __pyx_t_19) < 0) __PYX_ERR(1, 550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Array);

  /* "pyarrow/array.pxi":549
 *             (_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(1, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_20 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Array->tp_dict, __pyx_n_s_from_buffers, __pyx_t_20) < 0) __PYX_ERR(1, 550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Array);

  /* "pyarrow/array.pxi":780
 * 
 *     @staticmethod
 *     def from_numpy(obj):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CTensor] ctensor
 *         with nogil:
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_6Tensor_5from_numpy, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Tensor->tp_dict, __pyx_n_s_from_numpy, __pyx_t_20) < 0) __PYX_ERR(1, 780, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Tensor);

  /* "pyarrow/array.pxi":779
 * strides: {0.strides}""".format(self)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_numpy(obj):
 *         cdef shared_ptr[CTensor] ctensor
 */
  __Pyx_GetNameInClass(__pyx_t_20, (PyObject *)__pyx_ptype_7pyarrow_3lib_Tensor, __pyx_n_s_from_numpy); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_20); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 779, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Tensor->tp_dict, __pyx_n_s_from_numpy, __pyx_t_19) < 0) __PYX_ERR(1, 780, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Tensor);

  /* "pyarrow/array.pxi":1013
 * 
 *     @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(1, 1013, __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(1, 1013, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_ListArray);

  /* "pyarrow/array.pxi":1012
 *     """
 * 
 *     @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(1, 1013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_20 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 1012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_ListArray->tp_dict, __pyx_n_s_from_arrays, __pyx_t_20) < 0) __PYX_ERR(1, 1013, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_ListArray);

  /* "pyarrow/array.pxi":1057
 * 
 *     @staticmethod
 *     def from_dense(Array types, Array value_offsets, list children):             # <<<<<<<<<<<<<<
 *         """
 *         Construct dense UnionArray from arrays of int8 types, int32 offsets and
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_10UnionArray_1from_dense, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 1057, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_UnionArray->tp_dict, __pyx_n_s_from_dense, __pyx_t_20) < 0) __PYX_ERR(1, 1057, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_UnionArray);

  /* "pyarrow/array.pxi":1056
 *     """
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_dense(Array types, Array value_offsets, list children):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_20, (PyObject *)__pyx_ptype_7pyarrow_3lib_UnionArray, __pyx_n_s_from_dense); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 1057, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_20); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 1056, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_UnionArray->tp_dict, __pyx_n_s_from_dense, __pyx_t_19) < 0) __PYX_ERR(1, 1057, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_UnionArray);

  /* "pyarrow/array.pxi":1083
 * 
 *     @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(1, 1083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_UnionArray->tp_dict, __pyx_n_s_from_sparse, __pyx_t_19) < 0) __PYX_ERR(1, 1083, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_UnionArray);

  /* "pyarrow/array.pxi":1082
 *         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(1, 1083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_20 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 1082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_UnionArray->tp_dict, __pyx_n_s_from_sparse, __pyx_t_20) < 0) __PYX_ERR(1, 1083, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_UnionArray);

  /* "pyarrow/array.pxi":1113
 * 
 *     @staticmethod
 *     def from_buffers(int length, Buffer value_offsets, Buffer data,             # <<<<<<<<<<<<<<
 *                      Buffer null_bitmap=None, int null_count=-1,
 *                      int offset=0):
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_11StringArray_1from_buffers, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 1113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_StringArray->tp_dict, __pyx_n_s_from_buffers, __pyx_t_20) < 0) __PYX_ERR(1, 1113, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_StringArray);

  /* "pyarrow/array.pxi":1112
 *     """
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_buffers(int length, Buffer value_offsets, Buffer data,
 *                      Buffer null_bitmap=None, int null_count=-1,
 */
  __Pyx_GetNameInClass(__pyx_t_20, (PyObject *)__pyx_ptype_7pyarrow_3lib_StringArray, __pyx_n_s_from_buffers); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 1113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_20); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 1112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_StringArray->tp_dict, __pyx_n_s_from_buffers, __pyx_t_19) < 0) __PYX_ERR(1, 1113, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_StringArray);

  /* "pyarrow/array.pxi":1181
 * 
 *     @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(1, 1181, __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(1, 1181, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_DictionaryArray);

  /* "pyarrow/array.pxi":1180
 *         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(1, 1181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_20 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 1180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_DictionaryArray->tp_dict, __pyx_n_s_from_arrays, __pyx_t_20) < 0) __PYX_ERR(1, 1181, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_DictionaryArray);

  /* "pyarrow/array.pxi":1309
 * 
 *     @staticmethod
 *     def from_arrays(arrays, names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct StructArray from collection of arrays representing each field
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_11StructArray_5from_arrays, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 1309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_StructArray->tp_dict, __pyx_n_s_from_arrays, __pyx_t_20) < 0) __PYX_ERR(1, 1309, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_StructArray);

  /* "pyarrow/array.pxi":1308
 *         return [pyarrow_wrap_array(arr) for arr in arrays]
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_arrays(arrays, names=None):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_20, (PyObject *)__pyx_ptype_7pyarrow_3lib_StructArray, __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 1309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_20); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 1308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_StructArray->tp_dict, __pyx_n_s_from_arrays, __pyx_t_19) < 0) __PYX_ERR(1, 1309, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_StructArray);

  /* "pyarrow/array.pxi":1365
 * 
 * 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(1, 1365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_20 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::NA); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 1365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_20, ((PyObject *)__pyx_ptype_7pyarrow_3lib_NullArray)) < 0) __PYX_ERR(1, 1365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/array.pxi":1366
 * cdef dict _array_classes = {
 *     _Type_NA: NullArray,
 *     _Type_BOOL: BooleanArray,             # <<<<<<<<<<<<<<
 *     _Type_UINT8: UInt8Array,
 *     _Type_UINT16: UInt16Array,
 */
  __pyx_t_20 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::BOOL); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 1366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_20, ((PyObject *)__pyx_ptype_7pyarrow_3lib_BooleanArray)) < 0) __PYX_ERR(1, 1365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/array.pxi":1367
 *     _Type_NA: NullArray,
 *     _Type_BOOL: BooleanArray,
 *     _Type_UINT8: UInt8Array,             # <<<<<<<<<<<<<<
 *     _Type_UINT16: UInt16Array,
 *     _Type_UINT32: UInt32Array,
 */
  __pyx_t_20 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT8); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 1367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_20, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt8Array)) < 0) __PYX_ERR(1, 1365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/array.pxi":1368
 *     _Type_BOOL: BooleanArray,
 *     _Type_UINT8: UInt8Array,
 *     _Type_UINT16: UInt16Array,             # <<<<<<<<<<<<<<
 *     _Type_UINT32: UInt32Array,
 *     _Type_UINT64: UInt64Array,
 */
  __pyx_t_20 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT16); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 1368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_20, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt16Array)) < 0) __PYX_ERR(1, 1365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/array.pxi":1369
 *     _Type_UINT8: UInt8Array,
 *     _Type_UINT16: UInt16Array,
 *     _Type_UINT32: UInt32Array,             # <<<<<<<<<<<<<<
 *     _Type_UINT64: UInt64Array,
 *     _Type_INT8: Int8Array,
 */
  __pyx_t_20 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT32); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 1369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_20, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt32Array)) < 0) __PYX_ERR(1, 1365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/array.pxi":1370
 *     _Type_UINT16: UInt16Array,
 *     _Type_UINT32: UInt32Array,
 *     _Type_UINT64: UInt64Array,             # <<<<<<<<<<<<<<
 *     _Type_INT8: Int8Array,
 *     _Type_INT16: Int16Array,
 */
  __pyx_t_20 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT64); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 1370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_20, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt64Array)) < 0) __PYX_ERR(1, 1365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/array.pxi":1371
 *     _Type_UINT32: UInt32Array,
 *     _Type_UINT64: UInt64Array,
 *     _Type_INT8: Int8Array,             # <<<<<<<<<<<<<<
 *     _Type_INT16: Int16Array,
 *     _Type_INT32: Int32Array,
 */
  __pyx_t_20 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT8); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 1371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_20, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int8Array)) < 0) __PYX_ERR(1, 1365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/array.pxi":1372
 *     _Type_UINT64: UInt64Array,
 *     _Type_INT8: Int8Array,
 *     _Type_INT16: Int16Array,             # <<<<<<<<<<<<<<
 *     _Type_INT32: Int32Array,
 *     _Type_INT64: Int64Array,
 */
  __pyx_t_20 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT16); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 1372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_20, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int16Array)) < 0) __PYX_ERR(1, 1365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/array.pxi":1373
 *     _Type_INT8: Int8Array,
 *     _Type_INT16: Int16Array,
 *     _Type_INT32: Int32Array,             # <<<<<<<<<<<<<<
 *     _Type_INT64: Int64Array,
 *     _Type_DATE32: Date32Array,
 */
  __pyx_t_20 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT32); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 1373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_20, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int32Array)) < 0) __PYX_ERR(1, 1365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/array.pxi":1374
 *     _Type_INT16: Int16Array,
 *     _Type_INT32: Int32Array,
 *     _Type_INT64: Int64Array,             # <<<<<<<<<<<<<<
 *     _Type_DATE32: Date32Array,
 *     _Type_DATE64: Date64Array,
 */
  __pyx_t_20 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT64); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 1374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_20, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int64Array)) < 0) __PYX_ERR(1, 1365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/array.pxi":1375
 *     _Type_INT32: Int32Array,
 *     _Type_INT64: Int64Array,
 *     _Type_DATE32: Date32Array,             # <<<<<<<<<<<<<<
 *     _Type_DATE64: Date64Array,
 *     _Type_TIMESTAMP: TimestampArray,
 */
  __pyx_t_20 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DATE32); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 1375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_20, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Date32Array)) < 0) __PYX_ERR(1, 1365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/array.pxi":1376
 *     _Type_INT64: Int64Array,
 *     _Type_DATE32: Date32Array,
 *     _Type_DATE64: Date64Array,             # <<<<<<<<<<<<<<
 *     _Type_TIMESTAMP: TimestampArray,
 *     _Type_TIME32: Time32Array,
 */
  __pyx_t_20 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DATE64); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 1376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_20, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Date64Array)) < 0) __PYX_ERR(1, 1365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/array.pxi":1377
 *     _Type_DATE32: Date32Array,
 *     _Type_DATE64: Date64Array,
 *     _Type_TIMESTAMP: TimestampArray,             # <<<<<<<<<<<<<<
 *     _Type_TIME32: Time32Array,
 *     _Type_TIME64: Time64Array,
 */
  __pyx_t_20 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIMESTAMP); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 1377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_20, ((PyObject *)__pyx_ptype_7pyarrow_3lib_TimestampArray)) < 0) __PYX_ERR(1, 1365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/array.pxi":1378
 *     _Type_DATE64: Date64Array,
 *     _Type_TIMESTAMP: TimestampArray,
 *     _Type_TIME32: Time32Array,             # <<<<<<<<<<<<<<
 *     _Type_TIME64: Time64Array,
 *     _Type_HALF_FLOAT: HalfFloatArray,
 */
  __pyx_t_20 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIME32); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 1378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_20, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Time32Array)) < 0) __PYX_ERR(1, 1365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/array.pxi":1379
 *     _Type_TIMESTAMP: TimestampArray,
 *     _Type_TIME32: Time32Array,
 *     _Type_TIME64: Time64Array,             # <<<<<<<<<<<<<<
 *     _Type_HALF_FLOAT: HalfFloatArray,
 *     _Type_FLOAT: FloatArray,
 */
  __pyx_t_20 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIME64); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 1379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_20, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Time64Array)) < 0) __PYX_ERR(1, 1365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/array.pxi":1380
 *     _Type_TIME32: Time32Array,
 *     _Type_TIME64: Time64Array,
 *     _Type_HALF_FLOAT: HalfFloatArray,             # <<<<<<<<<<<<<<
 *     _Type_FLOAT: FloatArray,
 *     _Type_DOUBLE: DoubleArray,
 */
  __pyx_t_20 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::HALF_FLOAT); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 1380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_20, ((PyObject *)__pyx_ptype_7pyarrow_3lib_HalfFloatArray)) < 0) __PYX_ERR(1, 1365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/array.pxi":1381
 *     _Type_TIME64: Time64Array,
 *     _Type_HALF_FLOAT: HalfFloatArray,
 *     _Type_FLOAT: FloatArray,             # <<<<<<<<<<<<<<
 *     _Type_DOUBLE: DoubleArray,
 *     _Type_LIST: ListArray,
 */
  __pyx_t_20 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::FLOAT); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 1381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_20, ((PyObject *)__pyx_ptype_7pyarrow_3lib_FloatArray)) < 0) __PYX_ERR(1, 1365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/array.pxi":1382
 *     _Type_HALF_FLOAT: HalfFloatArray,
 *     _Type_FLOAT: FloatArray,
 *     _Type_DOUBLE: DoubleArray,             # <<<<<<<<<<<<<<
 *     _Type_LIST: ListArray,
 *     _Type_UNION: UnionArray,
 */
  __pyx_t_20 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DOUBLE); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 1382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_20, ((PyObject *)__pyx_ptype_7pyarrow_3lib_DoubleArray)) < 0) __PYX_ERR(1, 1365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/array.pxi":1383
 *     _Type_FLOAT: FloatArray,
 *     _Type_DOUBLE: DoubleArray,
 *     _Type_LIST: ListArray,             # <<<<<<<<<<<<<<
 *     _Type_UNION: UnionArray,
 *     _Type_BINARY: BinaryArray,
 */
  __pyx_t_20 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::LIST); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 1383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_20, ((PyObject *)__pyx_ptype_7pyarrow_3lib_ListArray)) < 0) __PYX_ERR(1, 1365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/array.pxi":1384
 *     _Type_DOUBLE: DoubleArray,
 *     _Type_LIST: ListArray,
 *     _Type_UNION: UnionArray,             # <<<<<<<<<<<<<<
 *     _Type_BINARY: BinaryArray,
 *     _Type_STRING: StringArray,
 */
  __pyx_t_20 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UNION); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 1384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_20, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UnionArray)) < 0) __PYX_ERR(1, 1365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/array.pxi":1385
 *     _Type_LIST: ListArray,
 *     _Type_UNION: UnionArray,
 *     _Type_BINARY: BinaryArray,             # <<<<<<<<<<<<<<
 *     _Type_STRING: StringArray,
 *     _Type_DICTIONARY: DictionaryArray,
 */
  __pyx_t_20 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::BINARY); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 1385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_20, ((PyObject *)__pyx_ptype_7pyarrow_3lib_BinaryArray)) < 0) __PYX_ERR(1, 1365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/array.pxi":1386
 *     _Type_UNION: UnionArray,
 *     _Type_BINARY: BinaryArray,
 *     _Type_STRING: StringArray,             # <<<<<<<<<<<<<<
 *     _Type_DICTIONARY: DictionaryArray,
 *     _Type_FIXED_SIZE_BINARY: FixedSizeBinaryArray,
 */
  __pyx_t_20 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::STRING); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 1386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_20, ((PyObject *)__pyx_ptype_7pyarrow_3lib_StringArray)) < 0) __PYX_ERR(1, 1365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/array.pxi":1387
 *     _Type_BINARY: BinaryArray,
 *     _Type_STRING: StringArray,
 *     _Type_DICTIONARY: DictionaryArray,             # <<<<<<<<<<<<<<
 *     _Type_FIXED_SIZE_BINARY: FixedSizeBinaryArray,
 *     _Type_DECIMAL: Decimal128Array,
 */
  __pyx_t_20 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DICTIONARY); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 1387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_20, ((PyObject *)__pyx_ptype_7pyarrow_3lib_DictionaryArray)) < 0) __PYX_ERR(1, 1365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/array.pxi":1388
 *     _Type_STRING: StringArray,
 *     _Type_DICTIONARY: DictionaryArray,
 *     _Type_FIXED_SIZE_BINARY: FixedSizeBinaryArray,             # <<<<<<<<<<<<<<
 *     _Type_DECIMAL: Decimal128Array,
 *     _Type_STRUCT: StructArray,
 */
  __pyx_t_20 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::FIXED_SIZE_BINARY); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 1388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_20, ((PyObject *)__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryArray)) < 0) __PYX_ERR(1, 1365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/array.pxi":1389
 *     _Type_DICTIONARY: DictionaryArray,
 *     _Type_FIXED_SIZE_BINARY: FixedSizeBinaryArray,
 *     _Type_DECIMAL: Decimal128Array,             # <<<<<<<<<<<<<<
 *     _Type_STRUCT: StructArray,
 * }
 */
  __pyx_t_20 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DECIMAL); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 1389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_20, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Decimal128Array)) < 0) __PYX_ERR(1, 1365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/array.pxi":1390
 *     _Type_FIXED_SIZE_BINARY: FixedSizeBinaryArray,
 *     _Type_DECIMAL: Decimal128Array,
 *     _Type_STRUCT: StructArray,             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_t_20 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::STRUCT); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 1390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_20, ((PyObject *)__pyx_ptype_7pyarrow_3lib_StructArray)) < 0) __PYX_ERR(1, 1365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 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, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(11, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_six, __pyx_t_19) < 0) __PYX_ERR(11, 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(11, 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_20 = __Pyx_Import(__pyx_n_s_pyarrow_compat, __pyx_t_19, 0); if (unlikely(!__pyx_t_20)) __PYX_ERR(11, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_ImportFrom(__pyx_t_20, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_19)) __PYX_ERR(11, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tobytes, __pyx_t_19) < 0) __PYX_ERR(11, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/table.pxi":264
 * 
 * 
 * def chunked_array(arrays, type=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct chunked array from list of array-like objects
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_99chunked_array, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(12, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_chunked_array, __pyx_t_20) < 0) __PYX_ERR(12, 264, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/table.pxi":304
 * 
 * 
 * def column(object field_or_name, arr):             # <<<<<<<<<<<<<<
 *     """
 *     Create Column object from field/string and array-like data
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_101column, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(12, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_column, __pyx_t_20) < 0) __PYX_ERR(12, 304, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/table.pxi":385
 * 
 *     @staticmethod
 *     def from_array(*args):             # <<<<<<<<<<<<<<
 *         return column(*args)
 * 
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_6Column_11from_array, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(12, 385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Column->tp_dict, __pyx_n_s_from_array, __pyx_t_20) < 0) __PYX_ERR(12, 385, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Column);

  /* "pyarrow/table.pxi":384
 *         return self.data[key]
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_array(*args):
 *         return column(*args)
 */
  __Pyx_GetNameInClass(__pyx_t_20, (PyObject *)__pyx_ptype_7pyarrow_3lib_Column, __pyx_n_s_from_array); if (unlikely(!__pyx_t_20)) __PYX_ERR(12, 385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_20); if (unlikely(!__pyx_t_19)) __PYX_ERR(12, 384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Column->tp_dict, __pyx_n_s_from_array, __pyx_t_19) < 0) __PYX_ERR(12, 385, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Column);

  /* "pyarrow/table.pxi":833
 * 
 *     @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(12, 833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);

  /* "pyarrow/table.pxi":832
 *         return Table.from_batches([self])._to_pandas(options, **kwargs)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_pandas(cls, df, Schema schema=None, bint preserve_index=True,
 *                     nthreads=None, columns=None):
 */
  __pyx_t_20 = __Pyx_Method_ClassMethod(__pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(12, 832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_RecordBatch->tp_dict, __pyx_n_s_from_pandas, __pyx_t_20) < 0) __PYX_ERR(12, 833, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_RecordBatch);

  /* "pyarrow/table.pxi":864
 * 
 *     @staticmethod
 *     def from_arrays(list arrays, names, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a RecordBatch from multiple pyarrow.Arrays
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_11RecordBatch_27from_arrays, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(12, 864, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_RecordBatch->tp_dict, __pyx_n_s_from_arrays, __pyx_t_20) < 0) __PYX_ERR(12, 864, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_RecordBatch);

  /* "pyarrow/table.pxi":863
 *         return cls.from_arrays(arrays, names, metadata)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_arrays(list arrays, names, metadata=None):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_20, (PyObject *)__pyx_ptype_7pyarrow_3lib_RecordBatch, __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_20)) __PYX_ERR(12, 864, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_20); if (unlikely(!__pyx_t_19)) __PYX_ERR(12, 863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_RecordBatch->tp_dict, __pyx_n_s_from_arrays, __pyx_t_19) < 0) __PYX_ERR(12, 864, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_RecordBatch);

  /* "pyarrow/table.pxi":908
 * 
 * 
 * def _reconstruct_record_batch(columns, schema):             # <<<<<<<<<<<<<<
 *     """
 *     Internal: reconstruct RecordBatch from pickled components.
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_103_reconstruct_record_batch, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(12, 908, __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(12, 908, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/table.pxi":915
 * 
 * 
 * def table_to_blocks(PandasOptions options, Table table,             # <<<<<<<<<<<<<<
 *                     MemoryPool memory_pool, categories):
 *     cdef:
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_105table_to_blocks, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(12, 915, __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(12, 915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/table.pxi":1087
 * 
 *     @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(12, 1087, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);

  /* "pyarrow/table.pxi":1086
 *         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_20 = __Pyx_Method_ClassMethod(__pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(12, 1086, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Table->tp_dict, __pyx_n_s_from_pandas, __pyx_t_20) < 0) __PYX_ERR(12, 1087, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Table);

  /* "pyarrow/table.pxi":1150
 * 
 *     @staticmethod
 *     def from_arrays(arrays, names=None, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a Table from Arrow arrays or columns
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_5Table_23from_arrays, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(12, 1150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Table->tp_dict, __pyx_n_s_from_arrays, __pyx_t_20) < 0) __PYX_ERR(12, 1150, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Table);

  /* "pyarrow/table.pxi":1149
 *         return cls.from_arrays(arrays, names=names, metadata=metadata)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_arrays(arrays, names=None, schema=None, metadata=None):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_20, (PyObject *)__pyx_ptype_7pyarrow_3lib_Table, __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_20)) __PYX_ERR(12, 1150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_20); if (unlikely(!__pyx_t_19)) __PYX_ERR(12, 1149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Table->tp_dict, __pyx_n_s_from_arrays, __pyx_t_19) < 0) __PYX_ERR(12, 1150, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Table);

  /* "pyarrow/table.pxi":1218
 * 
 *     @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_25from_batches, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(12, 1218, __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(12, 1218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Table);

  /* "pyarrow/table.pxi":1217
 *         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(12, 1218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_20 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(12, 1217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Table->tp_dict, __pyx_n_s_from_batches, __pyx_t_20) < 0) __PYX_ERR(12, 1218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Table);

  /* "pyarrow/table.pxi":1506
 * 
 * 
 * def _reconstruct_table(arrays, schema):             # <<<<<<<<<<<<<<
 *     """
 *     Internal: reconstruct pa.Table from pickled components.
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_107_reconstruct_table, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(12, 1506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reconstruct_table, __pyx_t_20) < 0) __PYX_ERR(12, 1506, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/table.pxi":1513
 * 
 * 
 * def concat_tables(tables):             # <<<<<<<<<<<<<<
 *     """
 *     Perform zero-copy concatenation of pyarrow.Table objects. Raises exception
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_109concat_tables, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(12, 1513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_concat_tables, __pyx_t_20) < 0) __PYX_ERR(12, 1513, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/io.pxi":23
 * from libc.stdlib cimport malloc, free
 * 
 * import re             # <<<<<<<<<<<<<<
 * import six
 * import sys
 */
  __pyx_t_20 = __Pyx_Import(__pyx_n_s_re, 0, 0); if (unlikely(!__pyx_t_20)) __PYX_ERR(6, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_20) < 0) __PYX_ERR(6, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/io.pxi":24
 * 
 * import re
 * import six             # <<<<<<<<<<<<<<
 * import sys
 * import threading
 */
  __pyx_t_20 = __Pyx_Import(__pyx_n_s_six, 0, 0); if (unlikely(!__pyx_t_20)) __PYX_ERR(6, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_six, __pyx_t_20) < 0) __PYX_ERR(6, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/io.pxi":25
 * import re
 * import six
 * import sys             # <<<<<<<<<<<<<<
 * import threading
 * import time
 */
  __pyx_t_20 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_20)) __PYX_ERR(6, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_20) < 0) __PYX_ERR(6, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/io.pxi":26
 * import six
 * import sys
 * import threading             # <<<<<<<<<<<<<<
 * import time
 * import warnings
 */
  __pyx_t_20 = __Pyx_Import(__pyx_n_s_threading, 0, 0); if (unlikely(!__pyx_t_20)) __PYX_ERR(6, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_threading, __pyx_t_20) < 0) __PYX_ERR(6, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/io.pxi":27
 * import sys
 * import threading
 * import time             # <<<<<<<<<<<<<<
 * import warnings
 * from io import BufferedIOBase, IOBase, UnsupportedOperation
 */
  __pyx_t_20 = __Pyx_Import(__pyx_n_s_time, 0, 0); if (unlikely(!__pyx_t_20)) __PYX_ERR(6, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_20) < 0) __PYX_ERR(6, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/io.pxi":28
 * import threading
 * import time
 * import warnings             # <<<<<<<<<<<<<<
 * from io import BufferedIOBase, IOBase, UnsupportedOperation
 * 
 */
  __pyx_t_20 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_20)) __PYX_ERR(6, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_20) < 0) __PYX_ERR(6, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/io.pxi":29
 * import time
 * import warnings
 * from io import BufferedIOBase, IOBase, UnsupportedOperation             # <<<<<<<<<<<<<<
 * 
 * from pyarrow.util import _stringify_path
 */
  __pyx_t_20 = PyList_New(3); if (unlikely(!__pyx_t_20)) __PYX_ERR(6, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_INCREF(__pyx_n_s_BufferedIOBase);
  __Pyx_GIVEREF(__pyx_n_s_BufferedIOBase);
  PyList_SET_ITEM(__pyx_t_20, 0, __pyx_n_s_BufferedIOBase);
  __Pyx_INCREF(__pyx_n_s_IOBase);
  __Pyx_GIVEREF(__pyx_n_s_IOBase);
  PyList_SET_ITEM(__pyx_t_20, 1, __pyx_n_s_IOBase);
  __Pyx_INCREF(__pyx_n_s_UnsupportedOperation);
  __Pyx_GIVEREF(__pyx_n_s_UnsupportedOperation);
  PyList_SET_ITEM(__pyx_t_20, 2, __pyx_n_s_UnsupportedOperation);
  __pyx_t_19 = __Pyx_Import(__pyx_n_s_io, __pyx_t_20, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = __Pyx_ImportFrom(__pyx_t_19, __pyx_n_s_BufferedIOBase); if (unlikely(!__pyx_t_20)) __PYX_ERR(6, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BufferedIOBase, __pyx_t_20) < 0) __PYX_ERR(6, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = __Pyx_ImportFrom(__pyx_t_19, __pyx_n_s_IOBase); if (unlikely(!__pyx_t_20)) __PYX_ERR(6, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_IOBase, __pyx_t_20) < 0) __PYX_ERR(6, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = __Pyx_ImportFrom(__pyx_t_19, __pyx_n_s_UnsupportedOperation); if (unlikely(!__pyx_t_20)) __PYX_ERR(6, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_UnsupportedOperation, __pyx_t_20) < 0) __PYX_ERR(6, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":31
 * from io import BufferedIOBase, IOBase, UnsupportedOperation
 * 
 * from pyarrow.util import _stringify_path             # <<<<<<<<<<<<<<
 * from pyarrow.compat import (
 *     builtin_pickle, frombytes, tobytes, encode_file_path, file_type)
 */
  __pyx_t_19 = PyList_New(1); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 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_20 = __Pyx_Import(__pyx_n_s_pyarrow_util, __pyx_t_19, 0); if (unlikely(!__pyx_t_20)) __PYX_ERR(6, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_ImportFrom(__pyx_t_20, __pyx_n_s_stringify_path); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 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(6, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/io.pxi":33
 * from pyarrow.util import _stringify_path
 * from pyarrow.compat import (
 *     builtin_pickle, frombytes, tobytes, encode_file_path, file_type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_20 = PyList_New(5); if (unlikely(!__pyx_t_20)) __PYX_ERR(6, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_INCREF(__pyx_n_s_builtin_pickle);
  __Pyx_GIVEREF(__pyx_n_s_builtin_pickle);
  PyList_SET_ITEM(__pyx_t_20, 0, __pyx_n_s_builtin_pickle);
  __Pyx_INCREF(__pyx_n_s_frombytes);
  __Pyx_GIVEREF(__pyx_n_s_frombytes);
  PyList_SET_ITEM(__pyx_t_20, 1, __pyx_n_s_frombytes);
  __Pyx_INCREF(__pyx_n_s_tobytes);
  __Pyx_GIVEREF(__pyx_n_s_tobytes);
  PyList_SET_ITEM(__pyx_t_20, 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_20, 3, __pyx_n_s_encode_file_path);
  __Pyx_INCREF(__pyx_n_s_file_type);
  __Pyx_GIVEREF(__pyx_n_s_file_type);
  PyList_SET_ITEM(__pyx_t_20, 4, __pyx_n_s_file_type);

  /* "pyarrow/io.pxi":32
 * 
 * from pyarrow.util import _stringify_path
 * from pyarrow.compat import (             # <<<<<<<<<<<<<<
 *     builtin_pickle, frombytes, tobytes, encode_file_path, file_type)
 * 
 */
  __pyx_t_19 = __Pyx_Import(__pyx_n_s_pyarrow_compat, __pyx_t_20, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = __Pyx_ImportFrom(__pyx_t_19, __pyx_n_s_builtin_pickle); if (unlikely(!__pyx_t_20)) __PYX_ERR(6, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_builtin_pickle, __pyx_t_20) < 0) __PYX_ERR(6, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = __Pyx_ImportFrom(__pyx_t_19, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_20)) __PYX_ERR(6, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_frombytes, __pyx_t_20) < 0) __PYX_ERR(6, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = __Pyx_ImportFrom(__pyx_t_19, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_20)) __PYX_ERR(6, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tobytes, __pyx_t_20) < 0) __PYX_ERR(6, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = __Pyx_ImportFrom(__pyx_t_19, __pyx_n_s_encode_file_path); if (unlikely(!__pyx_t_20)) __PYX_ERR(6, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_encode_file_path, __pyx_t_20) < 0) __PYX_ERR(6, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = __Pyx_ImportFrom(__pyx_t_19, __pyx_n_s_file_type); if (unlikely(!__pyx_t_20)) __PYX_ERR(6, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_file_type, __pyx_t_20) < 0) __PYX_ERR(6, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":37
 * 
 * # 64K
 * DEFAULT_BUFFER_SIZE = 2 ** 16             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEFAULT_BUFFER_SIZE, __pyx_int_65536) < 0) __PYX_ERR(6, 37, __pyx_L1_error)

  /* "pyarrow/io.pxi":565
 *             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(6, 565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_register); if (unlikely(!__pyx_t_20)) __PYX_ERR(6, 565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_t_20, ((PyObject *)__pyx_ptype_7pyarrow_3lib_NativeFile)); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":660
 * 
 *     @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(6, 660, __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(6, 660, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_MemoryMappedFile);

  /* "pyarrow/io.pxi":659
 *         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(6, 660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_20 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(6, 659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_MemoryMappedFile->tp_dict, __pyx_n_s_create, __pyx_t_20) < 0) __PYX_ERR(6, 660, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_MemoryMappedFile);

  /* "pyarrow/io.pxi":722
 * 
 * 
 * def memory_map(path, mode='r'):             # <<<<<<<<<<<<<<
 *     """
 *     Open memory map at file path. Size of the memory map cannot change
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_111memory_map, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(6, 722, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_memory_map, __pyx_t_20) < 0) __PYX_ERR(6, 722, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/io.pxi":742
 * 
 * 
 * def create_memory_map(path, size):             # <<<<<<<<<<<<<<
 *     """
 *     Create a file of the given size and memory-map it.
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_113create_memory_map, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(6, 742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_create_memory_map, __pyx_t_20) < 0) __PYX_ERR(6, 742, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/io.pxi":1035
 * 
 * 
 * def allocate_buffer(int64_t size, MemoryPool memory_pool=None,             # <<<<<<<<<<<<<<
 *                     resizable=False):
 *     """
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_115allocate_buffer, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(6, 1035, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_allocate_buffer, __pyx_t_20) < 0) __PYX_ERR(6, 1035, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/io.pxi":1215
 * 
 * 
 * def py_buffer(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Construct an Arrow buffer from a Python bytes-like or buffer-like object
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_117py_buffer, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(6, 1215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_py_buffer, __pyx_t_20) < 0) __PYX_ERR(6, 1215, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/io.pxi":1224
 * 
 * 
 * def foreign_buffer(address, size, base=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct an Arrow buffer with the given *address* and *size*,
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_119foreign_buffer, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(6, 1224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_foreign_buffer, __pyx_t_20) < 0) __PYX_ERR(6, 1224, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/io.pxi":1243
 * 
 * 
 * def as_buffer(object o):             # <<<<<<<<<<<<<<
 *     if isinstance(o, Buffer):
 *         return o
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_121as_buffer, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(6, 1243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_as_buffer, __pyx_t_20) < 0) __PYX_ERR(6, 1243, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/io.pxi":1349
 * 
 * 
 * def _detect_compression(path):             # <<<<<<<<<<<<<<
 *     if isinstance(path, six.string_types):
 *         if path.endswith('.bz2'):
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_123_detect_compression, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(6, 1349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_detect_compression, __pyx_t_20) < 0) __PYX_ERR(6, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/io.pxi":1361
 * 
 * 
 * def compress(object buf, codec='lz4', asbytes=False, memory_pool=None):             # <<<<<<<<<<<<<<
 *     """
 *     Compress data from buffer-like object.
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_125compress, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(6, 1361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_compress, __pyx_t_20) < 0) __PYX_ERR(6, 1361, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/io.pxi":1421
 * 
 * 
 * def decompress(object buf, decompressed_size=None, codec='lz4',             # <<<<<<<<<<<<<<
 *                asbytes=False, memory_pool=None):
 *     """
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_127decompress, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(6, 1421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_decompress, __pyx_t_20) < 0) __PYX_ERR(6, 1421, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/io.pxi":1478
 * 
 * 
 * def input_stream(source, compression='detect', buffer_size=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create an Arrow input stream.
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_129input_stream, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(6, 1478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_input_stream, __pyx_t_20) < 0) __PYX_ERR(6, 1478, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/io.pxi":1530
 * 
 * 
 * def output_stream(source, compression='detect', buffer_size=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create an Arrow output stream.
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_131output_stream, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(6, 1530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_output_stream, __pyx_t_20) < 0) __PYX_ERR(6, 1530, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/io-hdfs.pxi":21
 * # HDFS IO implementation
 * 
 * _HDFS_PATH_RE = re.compile(r'hdfs://(.*):(\d+)(.*)')             # <<<<<<<<<<<<<<
 * 
 * try:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_n_s_re); if (unlikely(!__pyx_t_20)) __PYX_ERR(2, 21, __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(2, 21, __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__376, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(2, 21, __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_HDFS_PATH_RE, __pyx_t_20) < 0) __PYX_ERR(2, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/io-hdfs.pxi":23
 * _HDFS_PATH_RE = re.compile(r'hdfs://(.*):(\d+)(.*)')
 * 
 * try:             # <<<<<<<<<<<<<<
 *     # Python 3
 *     from queue import Queue, Empty as QueueEmpty, Full as QueueFull
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
    __Pyx_XGOTREF(__pyx_t_21);
    __Pyx_XGOTREF(__pyx_t_22);
    __Pyx_XGOTREF(__pyx_t_23);
    /*try:*/ {

      /* "pyarrow/io-hdfs.pxi":25
 * try:
 *     # Python 3
 *     from queue import Queue, Empty as QueueEmpty, Full as QueueFull             # <<<<<<<<<<<<<<
 * except ImportError:
 *     from Queue import Queue, Empty as QueueEmpty, Full as QueueFull
 */
      __pyx_t_20 = PyList_New(3); if (unlikely(!__pyx_t_20)) __PYX_ERR(2, 25, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_INCREF(__pyx_n_s_Queue);
      __Pyx_GIVEREF(__pyx_n_s_Queue);
      PyList_SET_ITEM(__pyx_t_20, 0, __pyx_n_s_Queue);
      __Pyx_INCREF(__pyx_n_s_Empty);
      __Pyx_GIVEREF(__pyx_n_s_Empty);
      PyList_SET_ITEM(__pyx_t_20, 1, __pyx_n_s_Empty);
      __Pyx_INCREF(__pyx_n_s_Full);
      __Pyx_GIVEREF(__pyx_n_s_Full);
      PyList_SET_ITEM(__pyx_t_20, 2, __pyx_n_s_Full);
      __pyx_t_19 = __Pyx_Import(__pyx_n_s_queue, __pyx_t_20, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 25, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __pyx_t_20 = __Pyx_ImportFrom(__pyx_t_19, __pyx_n_s_Queue); if (unlikely(!__pyx_t_20)) __PYX_ERR(2, 25, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_20);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_Queue, __pyx_t_20) < 0) __PYX_ERR(2, 25, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __pyx_t_20 = __Pyx_ImportFrom(__pyx_t_19, __pyx_n_s_Empty); if (unlikely(!__pyx_t_20)) __PYX_ERR(2, 25, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_20);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_QueueEmpty, __pyx_t_20) < 0) __PYX_ERR(2, 25, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __pyx_t_20 = __Pyx_ImportFrom(__pyx_t_19, __pyx_n_s_Full); if (unlikely(!__pyx_t_20)) __PYX_ERR(2, 25, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_20);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_QueueFull, __pyx_t_20) < 0) __PYX_ERR(2, 25, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

      /* "pyarrow/io-hdfs.pxi":23
 * _HDFS_PATH_RE = re.compile(r'hdfs://(.*):(\d+)(.*)')
 * 
 * try:             # <<<<<<<<<<<<<<
 *     # Python 3
 *     from queue import Queue, Empty as QueueEmpty, Full as QueueFull
 */
    }
    __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
    __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
    __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
    goto __pyx_L7_try_end;
    __pyx_L2_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
    __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
    __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "pyarrow/io-hdfs.pxi":26
 *     # Python 3
 *     from queue import Queue, Empty as QueueEmpty, Full as QueueFull
 * except ImportError:             # <<<<<<<<<<<<<<
 *     from Queue import Queue, Empty as QueueEmpty, Full as QueueFull
 * 
 */
    __pyx_t_3 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_3) {
      __Pyx_AddTraceback("pyarrow.lib", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_19, &__pyx_t_20, &__pyx_t_18) < 0) __PYX_ERR(2, 26, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_GOTREF(__pyx_t_18);

      /* "pyarrow/io-hdfs.pxi":27
 *     from queue import Queue, Empty as QueueEmpty, Full as QueueFull
 * except ImportError:
 *     from Queue import Queue, Empty as QueueEmpty, Full as QueueFull             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_17 = PyList_New(3); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 27, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_INCREF(__pyx_n_s_Queue);
      __Pyx_GIVEREF(__pyx_n_s_Queue);
      PyList_SET_ITEM(__pyx_t_17, 0, __pyx_n_s_Queue);
      __Pyx_INCREF(__pyx_n_s_Empty);
      __Pyx_GIVEREF(__pyx_n_s_Empty);
      PyList_SET_ITEM(__pyx_t_17, 1, __pyx_n_s_Empty);
      __Pyx_INCREF(__pyx_n_s_Full);
      __Pyx_GIVEREF(__pyx_n_s_Full);
      PyList_SET_ITEM(__pyx_t_17, 2, __pyx_n_s_Full);
      __pyx_t_16 = __Pyx_Import(__pyx_n_s_Queue, __pyx_t_17, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(2, 27, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = __Pyx_ImportFrom(__pyx_t_16, __pyx_n_s_Queue); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 27, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_17);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_Queue, __pyx_t_17) < 0) __PYX_ERR(2, 27, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = __Pyx_ImportFrom(__pyx_t_16, __pyx_n_s_Empty); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 27, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_17);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_QueueEmpty, __pyx_t_17) < 0) __PYX_ERR(2, 27, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = __Pyx_ImportFrom(__pyx_t_16, __pyx_n_s_Full); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 27, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_17);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_QueueFull, __pyx_t_17) < 0) __PYX_ERR(2, 27, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 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/io-hdfs.pxi":23
 * _HDFS_PATH_RE = re.compile(r'hdfs://(.*):(\d+)(.*)')
 * 
 * try:             # <<<<<<<<<<<<<<
 *     # Python 3
 *     from queue import Queue, Empty as QueueEmpty, Full as QueueFull
 */
    __Pyx_XGIVEREF(__pyx_t_21);
    __Pyx_XGIVEREF(__pyx_t_22);
    __Pyx_XGIVEREF(__pyx_t_23);
    __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23);
    goto __pyx_L1_error;
    __pyx_L3_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_21);
    __Pyx_XGIVEREF(__pyx_t_22);
    __Pyx_XGIVEREF(__pyx_t_23);
    __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23);
    __pyx_L7_try_end:;
  }

  /* "pyarrow/io-hdfs.pxi":30
 * 
 * 
 * def have_libhdfs():             # <<<<<<<<<<<<<<
 *     try:
 *         with nogil:
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_133have_libhdfs, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_have_libhdfs, __pyx_t_18) < 0) __PYX_ERR(2, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/io-hdfs.pxi":39
 * 
 * 
 * def have_libhdfs3():             # <<<<<<<<<<<<<<
 *     try:
 *         with nogil:
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_135have_libhdfs3, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_have_libhdfs3, __pyx_t_18) < 0) __PYX_ERR(2, 39, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/io-hdfs.pxi":48
 * 
 * 
 * def strip_hdfs_abspath(path):             # <<<<<<<<<<<<<<
 *     m = _HDFS_PATH_RE.match(path)
 *     if m:
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_137strip_hdfs_abspath, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_strip_hdfs_abspath, __pyx_t_18) < 0) __PYX_ERR(2, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/io-hdfs.pxi":109
 * 
 *     @classmethod
 *     def connect(cls, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         return cls(*args, **kwargs)
 * 
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_HadoopFileSystem, __pyx_n_s_connect); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);

  /* "pyarrow/io-hdfs.pxi":108
 *         self.is_open = True
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def connect(cls, *args, **kwargs):
 *         return cls(*args, **kwargs)
 */
  __pyx_t_20 = __Pyx_Method_ClassMethod(__pyx_t_18); if (unlikely(!__pyx_t_20)) __PYX_ERR(2, 108, __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_HadoopFileSystem->tp_dict, __pyx_n_s_connect, __pyx_t_20) < 0) __PYX_ERR(2, 109, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_HadoopFileSystem);

  /* "pyarrow/ipc.pxi":118
 * 
 *     @staticmethod
 *     def open_stream(source):             # <<<<<<<<<<<<<<
 *         cdef MessageReader result = MessageReader.__new__(MessageReader)
 *         cdef shared_ptr[InputStream] in_stream
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_13MessageReader_5open_stream, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(7, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_MessageReader->tp_dict, __pyx_n_s_open_stream, __pyx_t_20) < 0) __PYX_ERR(7, 118, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_MessageReader);

  /* "pyarrow/ipc.pxi":117
 *                         "instead.".format(self.__class__.__name__))
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def open_stream(source):
 *         cdef MessageReader result = MessageReader.__new__(MessageReader)
 */
  __Pyx_GetNameInClass(__pyx_t_20, (PyObject *)__pyx_ptype_7pyarrow_3lib_MessageReader, __pyx_n_s_open_stream); if (unlikely(!__pyx_t_20)) __PYX_ERR(7, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_18 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_20); if (unlikely(!__pyx_t_18)) __PYX_ERR(7, 117, __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_MessageReader->tp_dict, __pyx_n_s_open_stream, __pyx_t_18) < 0) __PYX_ERR(7, 118, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_MessageReader);

  /* "pyarrow/ipc.pxi":380
 *     # 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_18, (PyObject *)__pyx_ptype_7pyarrow_3lib__RecordBatchFileReader, __pyx_n_s_get_batch); if (unlikely(!__pyx_t_18)) __PYX_ERR(7, 380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib__RecordBatchFileReader->tp_dict, __pyx_n_s_get_record_batch, __pyx_t_18) < 0) __PYX_ERR(7, 380, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib__RecordBatchFileReader);

  /* "pyarrow/ipc.pxi":403
 * 
 * 
 * def get_tensor_size(Tensor tensor):             # <<<<<<<<<<<<<<
 *     """
 *     Return total size of serialized Tensor including metadata and padding
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_139get_tensor_size, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(7, 403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_tensor_size, __pyx_t_18) < 0) __PYX_ERR(7, 403, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/ipc.pxi":413
 * 
 * 
 * def get_record_batch_size(RecordBatch batch):             # <<<<<<<<<<<<<<
 *     """
 *     Return total size of serialized RecordBatch including metadata and padding
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_141get_record_batch_size, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(7, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_record_batch_size, __pyx_t_18) < 0) __PYX_ERR(7, 413, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/ipc.pxi":423
 * 
 * 
 * def write_tensor(Tensor tensor, NativeFile dest):             # <<<<<<<<<<<<<<
 *     """
 *     Write pyarrow.Tensor to pyarrow.NativeFile object its current position
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_143write_tensor, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(7, 423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_write_tensor, __pyx_t_18) < 0) __PYX_ERR(7, 423, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/ipc.pxi":451
 * 
 * 
 * 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_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_145read_tensor, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(7, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_read_tensor, __pyx_t_18) < 0) __PYX_ERR(7, 451, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/ipc.pxi":476
 * 
 * 
 * def read_message(source):             # <<<<<<<<<<<<<<
 *     """
 *     Read length-prefixed message from file or buffer-like object
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_147read_message, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(7, 476, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_read_message, __pyx_t_18) < 0) __PYX_ERR(7, 476, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/ipc.pxi":512
 * 
 * 
 * def read_schema(obj):             # <<<<<<<<<<<<<<
 *     """
 *     Read Schema from message or buffer
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_149read_schema, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(7, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_read_schema, __pyx_t_18) < 0) __PYX_ERR(7, 512, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/ipc.pxi":539
 * 
 * 
 * def read_record_batch(obj, Schema schema):             # <<<<<<<<<<<<<<
 *     """
 *     Read RecordBatch from message, given a known schema
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_151read_record_batch, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(7, 539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_read_record_batch, __pyx_t_18) < 0) __PYX_ERR(7, 539, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/feather.pxi":22
 * 
 * 
 * class FeatherError(Exception):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) __PYX_ERR(13, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  __Pyx_GIVEREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  PyTuple_SET_ITEM(__pyx_t_18, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  __pyx_t_20 = __Pyx_CalculateMetaclass(NULL, __pyx_t_18); if (unlikely(!__pyx_t_20)) __PYX_ERR(13, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_19 = __Pyx_Py3MetaclassPrepare(__pyx_t_20, __pyx_t_18, __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_16 = __Pyx_Py3ClassCreate(__pyx_t_20, __pyx_n_s_FeatherError, __pyx_t_18, __pyx_t_19, NULL, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(13, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FeatherError, __pyx_t_16) < 0) __PYX_ERR(13, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 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":20
 * from cpython.ref cimport PyObject
 * 
 * import six             # <<<<<<<<<<<<<<
 * 
 * from pyarrow.compat import pickle
 */
  __pyx_t_18 = __Pyx_Import(__pyx_n_s_six, 0, 0); if (unlikely(!__pyx_t_18)) __PYX_ERR(14, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_six, __pyx_t_18) < 0) __PYX_ERR(14, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/serialization.pxi":22
 * import six
 * 
 * from pyarrow.compat import pickle             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_18 = PyList_New(1); if (unlikely(!__pyx_t_18)) __PYX_ERR(14, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_INCREF(__pyx_n_s_pickle);
  __Pyx_GIVEREF(__pyx_n_s_pickle);
  PyList_SET_ITEM(__pyx_t_18, 0, __pyx_n_s_pickle);
  __pyx_t_20 = __Pyx_Import(__pyx_n_s_pyarrow_compat, __pyx_t_18, 0); if (unlikely(!__pyx_t_20)) __PYX_ERR(14, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __pyx_t_18 = __Pyx_ImportFrom(__pyx_t_20, __pyx_n_s_pickle); if (unlikely(!__pyx_t_18)) __PYX_ERR(14, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pickle, __pyx_t_18) < 0) __PYX_ERR(14, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/serialization.pxi":25
 * 
 * 
 * def is_named_tuple(cls):             # <<<<<<<<<<<<<<
 *     """Return True if cls is a namedtuple and False otherwise."""
 *     b = cls.__bases__
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_153is_named_tuple, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(14, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_named_tuple, __pyx_t_20) < 0) __PYX_ERR(14, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/serialization.pxi":36
 * 
 * 
 * class SerializationCallbackError(ArrowSerializationError):             # <<<<<<<<<<<<<<
 *     def __init__(self, message, example_object):
 *         ArrowSerializationError.__init__(self, message)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_n_s_ArrowSerializationError); if (unlikely(!__pyx_t_20)) __PYX_ERR(14, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) __PYX_ERR(14, 36, __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, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_19 = __Pyx_Py3MetaclassPrepare(__pyx_t_20, __pyx_t_18, __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, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);

  /* "pyarrow/serialization.pxi":37
 * 
 * class SerializationCallbackError(ArrowSerializationError):
 *     def __init__(self, message, example_object):             # <<<<<<<<<<<<<<
 *         ArrowSerializationError.__init__(self, message)
 *         self.example_object = example_object
 */
  __pyx_t_16 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_26SerializationCallbackError_1__init__, 0, __pyx_n_s_SerializationCallbackError___ini, NULL, __pyx_n_s_pyarrow_lib, __pyx_d, ((PyObject *)__pyx_codeobj__400)); if (unlikely(!__pyx_t_16)) __PYX_ERR(14, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  if (__Pyx_SetNameInClass(__pyx_t_19, __pyx_n_s_init, __pyx_t_16) < 0) __PYX_ERR(14, 37, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pyarrow/serialization.pxi":36
 * 
 * 
 * class SerializationCallbackError(ArrowSerializationError):             # <<<<<<<<<<<<<<
 *     def __init__(self, message, example_object):
 *         ArrowSerializationError.__init__(self, message)
 */
  __pyx_t_16 = __Pyx_Py3ClassCreate(__pyx_t_20, __pyx_n_s_SerializationCallbackError, __pyx_t_18, __pyx_t_19, NULL, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(14, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SerializationCallbackError, __pyx_t_16) < 0) __PYX_ERR(14, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 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":42
 * 
 * 
 * class DeserializationCallbackError(ArrowSerializationError):             # <<<<<<<<<<<<<<
 *     def __init__(self, message, type_id):
 *         ArrowSerializationError.__init__(self, message)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_ArrowSerializationError); if (unlikely(!__pyx_t_18)) __PYX_ERR(14, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(14, 42, __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, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_Py3MetaclassPrepare(__pyx_t_18, __pyx_t_20, __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, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);

  /* "pyarrow/serialization.pxi":43
 * 
 * class DeserializationCallbackError(ArrowSerializationError):
 *     def __init__(self, message, type_id):             # <<<<<<<<<<<<<<
 *         ArrowSerializationError.__init__(self, message)
 *         self.type_id = type_id
 */
  __pyx_t_16 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_28DeserializationCallbackError_1__init__, 0, __pyx_n_s_DeserializationCallbackError___i, NULL, __pyx_n_s_pyarrow_lib, __pyx_d, ((PyObject *)__pyx_codeobj__402)); if (unlikely(!__pyx_t_16)) __PYX_ERR(14, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  if (__Pyx_SetNameInClass(__pyx_t_19, __pyx_n_s_init, __pyx_t_16) < 0) __PYX_ERR(14, 43, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pyarrow/serialization.pxi":42
 * 
 * 
 * class DeserializationCallbackError(ArrowSerializationError):             # <<<<<<<<<<<<<<
 *     def __init__(self, message, type_id):
 *         ArrowSerializationError.__init__(self, message)
 */
  __pyx_t_16 = __Pyx_Py3ClassCreate(__pyx_t_18, __pyx_n_s_DeserializationCallbackError, __pyx_t_20, __pyx_t_19, NULL, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(14, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DeserializationCallbackError, __pyx_t_16) < 0) __PYX_ERR(14, 42, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 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":219
 * 
 * 
 * _default_serialization_context = SerializationContext()             # <<<<<<<<<<<<<<
 * _default_context_initialized = False
 * 
 */
  __pyx_t_20 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_SerializationContext)); if (unlikely(!__pyx_t_20)) __PYX_ERR(14, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_serialization_context, __pyx_t_20) < 0) __PYX_ERR(14, 219, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/serialization.pxi":220
 * 
 * _default_serialization_context = SerializationContext()
 * _default_context_initialized = False             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_context_initialized, Py_False) < 0) __PYX_ERR(14, 220, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":223
 * 
 * 
 * def _get_default_context():             # <<<<<<<<<<<<<<
 *     global _default_context_initialized
 *     from pyarrow.serialization import register_default_serialization_handlers
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_155_get_default_context, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(14, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_default_context, __pyx_t_20) < 0) __PYX_ERR(14, 223, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/serialization.pxi":291
 * 
 *     @staticmethod
 *     def from_components(components):             # <<<<<<<<<<<<<<
 *         """
 *         Reconstruct SerializedPyObject from output of
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_18SerializedPyObject_7from_components, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(14, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_SerializedPyObject->tp_dict, __pyx_n_s_from_components, __pyx_t_20) < 0) __PYX_ERR(14, 291, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_SerializedPyObject);

  /* "pyarrow/serialization.pxi":290
 *         return output
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_components(components):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_20, (PyObject *)__pyx_ptype_7pyarrow_3lib_SerializedPyObject, __pyx_n_s_from_components); if (unlikely(!__pyx_t_20)) __PYX_ERR(14, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_18 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_20); if (unlikely(!__pyx_t_18)) __PYX_ERR(14, 290, __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_SerializedPyObject->tp_dict, __pyx_n_s_from_components, __pyx_t_18) < 0) __PYX_ERR(14, 291, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_SerializedPyObject);

  /* "pyarrow/serialization.pxi":333
 * 
 * 
 * def serialize(object value, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Serialize a Python sequence
 * 
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_157serialize, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(14, 333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize, __pyx_t_18) < 0) __PYX_ERR(14, 333, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/serialization.pxi":359
 * 
 * 
 * def serialize_to(object value, sink, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Serialize a Python sequence to a file.
 * 
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_159serialize_to, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(14, 359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_to, __pyx_t_18) < 0) __PYX_ERR(14, 359, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/serialization.pxi":376
 * 
 * 
 * def read_serialized(source, base=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Read serialized Python sequence from file-like object
 * 
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_161read_serialized, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(14, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_read_serialized, __pyx_t_18) < 0) __PYX_ERR(14, 376, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/serialization.pxi":402
 * 
 * 
 * def deserialize_from(source, object base, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Deserialize a Python sequence from a file.
 * 
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_163deserialize_from, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(14, 402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_deserialize_from, __pyx_t_18) < 0) __PYX_ERR(14, 402, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/serialization.pxi":424
 * 
 * 
 * def deserialize_components(components, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """
 *     Reconstruct Python object from output of SerializedPyObject.to_components
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_165deserialize_components, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(14, 424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_deserialize_components, __pyx_t_18) < 0) __PYX_ERR(14, 424, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/serialization.pxi":442
 * 
 * 
 * def deserialize(obj, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """
 *     EXPERIMENTAL: Deserialize Python object from Buffer or other Python object
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_167deserialize, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(14, 442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_deserialize, __pyx_t_18) < 0) __PYX_ERR(14, 442, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/benchmark.pxi":19
 * 
 * 
 * def benchmark_PandasObjectIsNull(list obj):             # <<<<<<<<<<<<<<
 *     Benchmark_PandasObjectIsNull(obj)
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_169benchmark_PandasObjectIsNull, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(15, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_benchmark_PandasObjectIsNull, __pyx_t_18) < 0) __PYX_ERR(15, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "(tree fragment)":1
 * def __pyx_unpickle__PandasAPIShim(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_171__pyx_unpickle__PandasAPIShim, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle__PandasAPIShim, __pyx_t_18) < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "(tree fragment)":11
 *         __pyx_unpickle__PandasAPIShim__set_state(<_PandasAPIShim> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle__PandasAPIShim__set_state(_PandasAPIShim __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result._array_like_types = __pyx_state[0]; __pyx_result._categorical_type = __pyx_state[1]; __pyx_result._compat_module = __pyx_state[2]; __pyx_result._data_frame = __pyx_state[3]; __pyx_result._datetimetz_type = __pyx_state[4]; __pyx_result._have_pandas = __pyx_state[5]; __pyx_result._index = __pyx_state[6]; __pyx_result._loose_version = __pyx_state[7]; __pyx_result._pd = __pyx_state[8]; __pyx_result._series = __pyx_state[9]; __pyx_result._tried_importing_pandas = __pyx_state[10]; __pyx_result._types_api = __pyx_state[11]; __pyx_result._version = __pyx_state[12]
 *     if len(__pyx_state) > 13 and hasattr(__pyx_result, '__dict__'):
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_173__pyx_unpickle_Scalar, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Scalar, __pyx_t_18) < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "(tree fragment)":1
 * def __pyx_unpickle__PandasConvertible(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_175__pyx_unpickle__PandasConvertible, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle__PandasConvertibl, __pyx_t_18) < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "(tree fragment)":11
 *         __pyx_unpickle__PandasConvertible__set_state(<_PandasConvertible> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle__PandasConvertible__set_state(_PandasConvertible __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[0])
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_177__pyx_unpickle_SerializationContext, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_SerializationCont, __pyx_t_18) < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 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_18 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_18)) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_18, __pyx_kp_u_Schema_from_pandas_line_720, __pyx_kp_u_Returns_implied_schema_from_dat) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_18, __pyx_kp_u_array_line_87, __pyx_kp_u_Create_pyarrow_Array_instance_f) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_18, __pyx_kp_u_Array_cast_line_417, __pyx_kp_u_Cast_array_values_to_another_da) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_18, __pyx_kp_u_Table_from_pandas_line_1087, __pyx_kp_u_Convert_pandas_DataFrame_to_an) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_18) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "vector.from_py":45
 * 
 * @cname("__pyx_convert_vector_from_py_std_3a__3a_string")
 * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef vector[X] v
 *     for item in o:
 */

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_20);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init pyarrow.lib", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_CLEAR(__pyx_m);
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init pyarrow.lib");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #elif PY_MAJOR_VERSION >= 3
  return __pyx_m;
  #else
  return;
  #endif
}

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule(modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, "RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* PyObjectGetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = func->ob_type->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyErrFetchRestore */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}
#endif

/* RaiseException */
#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    __Pyx_PyThreadState_declare
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause) {
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = __Pyx_PyThreadState_Current;
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* KeywordStringCheck */
static int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CYTHON_COMPILING_IN_PYPY
    if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
        goto invalid_keyword;
    return 1;
#else
    while (PyDict_Next(kwdict, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_Check(key)))
        #endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
    }
    if ((!kw_allowed) && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_MAJOR_VERSION < 3
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

/* GetTopmostException */
#if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
           exc_info->previous_item != NULL)
    {
        exc_info = exc_info->previous_item;
    }
    return exc_info;
}
#endif

/* SaveResetException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    *type = exc_info->exc_type;
    *value = exc_info->exc_value;
    *tb = exc_info->exc_traceback;
    #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    #endif
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = type;
    exc_info->exc_value = value;
    exc_info->exc_traceback = tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
#endif

/* PyErrExceptionMatches */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    PyObject *exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
    if (unlikely(PyTuple_Check(err)))
        return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
}
#endif

/* GetException */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
#endif
{
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    #if CYTHON_USE_EXC_INFO_STACK
    {
        _PyErr_StackItem *exc_info = tstate->exc_info;
        tmp_type = exc_info->exc_type;
        tmp_value = exc_info->exc_value;
        tmp_tb = exc_info->exc_traceback;
        exc_info->exc_type = local_type;
        exc_info->exc_value = local_value;
        exc_info->exc_traceback = local_tb;
    }
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

/* ImportFrom */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

/* PyCFunctionFastCall */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
    PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
    PyObject *self = PyCFunction_GET_SELF(func);
    int flags = PyCFunction_GET_FLAGS(func);
    assert(PyCFunction_Check(func));
    assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
    assert(nargs >= 0);
    assert(nargs == 0 || args != NULL);
    /* _PyCFunction_FastCallDict() must not be called with an exception set,
       because it may clear it (directly or indirectly) and so the
       caller loses its exception */
    assert(!PyErr_Occurred());
    if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
        return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
    } else {
        return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
    }
}
#endif

/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                               PyObject *globals) {
    PyFrameObject *f;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject **fastlocals;
    Py_ssize_t i;
    PyObject *result;
    assert(globals != NULL);
    /* XXX Perhaps we should create a specialized
       PyFrame_New() that doesn't take locals, but does
       take builtins without sanity checking them.
       */
    assert(tstate != NULL);
    f = PyFrame_New(tstate, co, globals, NULL);
    if (f == NULL) {
        return NULL;
    }
    fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
    for (i = 0; i < na; i++) {
        Py_INCREF(*args);
        fastlocals[i] = *args++;
    }
    result = PyEval_EvalFrameEx(f,0);
    ++tstate->recursion_depth;
    Py_DECREF(f);
    --tstate->recursion_depth;
    return result;
}
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
    PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
    PyObject *globals = PyFunction_GET_GLOBALS(func);
    PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
    PyObject *closure;
#if PY_MAJOR_VERSION >= 3
    PyObject *kwdefs;
#endif
    PyObject *kwtuple, **k;
    PyObject **d;
    Py_ssize_t nd;
    Py_ssize_t nk;
    PyObject *result;
    assert(kwargs == NULL || PyDict_Check(kwargs));
    nk = kwargs ? PyDict_Size(kwargs) : 0;
    if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
        return NULL;
    }
    if (
#if PY_MAJOR_VERSION >= 3
            co->co_kwonlyargcount == 0 &&
#endif
            likely(kwargs == NULL || nk == 0) &&
            co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
        if (argdefs == NULL && co->co_argcount == nargs) {
            result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
            goto done;
        }
        else if (nargs == 0 && argdefs != NULL
                 && co->co_argcount == Py_SIZE(argdefs)) {
            /* function called with no arguments, but all parameters have
               a default value: use default values as arguments .*/
            args = &PyTuple_GET_ITEM(argdefs, 0);
            result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
            goto done;
        }
    }
    if (kwargs != NULL) {
        Py_ssize_t pos, i;
        kwtuple = PyTuple_New(2 * nk);
        if (kwtuple == NULL) {
            result = NULL;
            goto done;
        }
        k = &PyTuple_GET_ITEM(kwtuple, 0);
        pos = i = 0;
        while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
            Py_INCREF(k[i]);
            Py_INCREF(k[i+1]);
            i += 2;
        }
        nk = i / 2;
    }
    else {
        kwtuple = NULL;
        k = NULL;
    }
    closure = PyFunction_GET_CLOSURE(func);
#if PY_MAJOR_VERSION >= 3
    kwdefs = PyFunction_GET_KW_DEFAULTS(func);
#endif
    if (argdefs != NULL) {
        d = &PyTuple_GET_ITEM(argdefs, 0);
        nd = Py_SIZE(argdefs);
    }
    else {
        d = NULL;
        nd = 0;
    }
#if PY_MAJOR_VERSION >= 3
    result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
#else
    result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, closure);
#endif
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif
#endif

/* PyObjectCall2Args */
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args, *result = NULL;
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyFunction_FastCall(function, args, 2);
    }
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyCFunction_FastCall(function, args, 2);
    }
    #endif
    args = PyTuple_New(2);
    if (unlikely(!args)) goto done;
    Py_INCREF(arg1);
    PyTuple_SET_ITEM(args, 0, arg1);
    Py_INCREF(arg2);
    PyTuple_SET_ITEM(args, 1, arg2);
    Py_INCREF(function);
    result = __Pyx_PyObject_Call(function, args, NULL);
    Py_DECREF(args);
    Py_DECREF(function);
done:
    return result;
}

/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallOneArg */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, &arg, 1);
    }
#endif
    if (likely(PyCFunction_Check(func))) {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
#if CYTHON_FAST_PYCCALL
        } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
            return __Pyx_PyCFunction_FastCall(func, &arg, 1);
#endif
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_Pack(1, arg);
    if (unlikely(!args)) return NULL;
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
#endif

/* WriteUnraisableException */
static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
                                  int full_traceback, CYTHON_UNUSED int nogil) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_PyThreadState_declare
#ifdef WITH_THREAD
    PyGILState_STATE state;
    if (nogil)
        state = PyGILState_Ensure();
#ifdef _MSC_VER
    else state = (PyGILState_STATE)-1;
#endif
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(1);
    }
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
#ifdef WITH_THREAD
    if (nogil)
        PyGILState_Release(state);
#endif
}

/* PyDictVersioning */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
    PyObject **dictptr = NULL;
    Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
    if (offset) {
#if CYTHON_COMPILING_IN_CPYTHON
        dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
#else
        dictptr = _PyObject_GetDictPtr(obj);
#endif
    }
    return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
}
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
        return 0;
    return obj_dict_version == __Pyx_get_object_dict_version(obj);
}
#endif

/* 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);
}

/* GetAttr3 */
static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        return NULL;
    __Pyx_PyErr_Clear();
    Py_INCREF(d);
    return d;
}
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r = __Pyx_GetAttr(o, n);
    return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
}

/* GetModuleGlobalName */
#if CYTHON_USE_DICT_VERSIONS
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
#else
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
#endif
{
    PyObject *result;
#if !CYTHON_AVOID_BORROWED_REFS
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
    result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    } else if (unlikely(PyErr_Occurred())) {
        return NULL;
    }
#else
    result = PyDict_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
#endif
#else
    result = PyObject_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
    PyErr_Clear();
#endif
    return __Pyx_GetBuiltinName(name);
}

/* ArgTypeTest */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
{
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    else if (exact) {
        #if PY_MAJOR_VERSION == 2
        if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
        #endif
    }
    else {
        if (likely(__Pyx_TypeCheck(obj, type))) return 1;
    }
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
    return 0;
}

/* 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;
}

/* DictGetItem */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (!PyErr_Occurred()) {
            if (unlikely(PyTuple_Check(key))) {
                PyObject* args = PyTuple_Pack(1, key);
                if (likely(args)) {
                    PyErr_SetObject(PyExc_KeyError, args);
                    Py_DECREF(args);
                }
            } else {
                PyErr_SetObject(PyExc_KeyError, key);
            }
        }
        return NULL;
    }
    Py_INCREF(value);
    return value;
}
#endif

/* ExtTypeTest */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(__Pyx_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

/* GetItemInt */
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyTuple_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

/* 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

/* 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

/* 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

/* FetchCommonType */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* fake_module;
    PyTypeObject* cached_type = NULL;
    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
    if (!fake_module) return NULL;
    Py_INCREF(fake_module);
    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
    if (cached_type) {
        if (!PyType_Check((PyObject*)cached_type)) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s is not a type object",
                type->tp_name);
            goto bad;
        }
        if (cached_type->tp_basicsize != type->tp_basicsize) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s has the wrong size, try recompiling",
                type->tp_name);
            goto bad;
        }
    } else {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        if (PyType_Ready(type) < 0) goto bad;
        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
            goto bad;
        Py_INCREF(type);
        cached_type = type;
    }
done:
    Py_DECREF(fake_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* CythonFunction */
#include <structmember.h>
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
    if (unlikely(op->func_doc == NULL)) {
        if (op->func.m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp = op->func_doc;
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    op->func_doc = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    if (unlikely(op->func_name == NULL)) {
#if PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = op->func_name;
    Py_INCREF(value);
    op->func_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = op->func_qualname;
    Py_INCREF(value);
    op->func_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
{
    PyObject *self;
    self = m->func_closure;
    if (self == NULL)
        self = Py_None;
    Py_INCREF(self);
    return self;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    tmp = op->func_dict;
    Py_INCREF(value);
    op->func_dict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    #else
    op->defaults_tuple = PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = PySequence_ITEM(res, 1);
        if (unlikely(!op->defaults_kwdict)) result = -1;
    }
    #endif
    Py_DECREF(res);
    return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyTuple_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_tuple;
    op->defaults_tuple = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->defaults_tuple;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_kwdict;
    op->defaults_kwdict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->defaults_kwdict;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value || value == Py_None) {
        value = NULL;
    } else if (!PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    tmp = op->func_annotations;
    op->func_annotations = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->func_annotations;
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
    {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromString(m->func.m_ml->ml_name);
#else
    return PyString_FromString(m->func.m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
    if (op == NULL)
        return NULL;
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
    op->func.m_ml = ml;
    op->func.m_self = (PyObject *) op;
    Py_XINCREF(closure);
    op->func_closure = closure;
    Py_XINCREF(module);
    op->func.m_module = module;
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
    op->func_classobj = NULL;
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    PyObject_GC_Track(op);
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
    Py_CLEAR(m->func.m_module);
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
    Py_CLEAR(m->func_classobj);
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyObject_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    PyObject_GC_Del(m);
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    __Pyx__CyFunction_dealloc(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
    Py_VISIT(m->func.m_module);
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    Py_VISIT(m->func_code);
    Py_VISIT(m->func_classobj);
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
{
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
        Py_INCREF(func);
        return func;
    }
    if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
        if (type == NULL)
            type = (PyObject *)(Py_TYPE(obj));
        return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
    }
    if (obj == Py_None)
        obj = NULL;
    return __Pyx_PyMethod_New(func, obj, type);
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    Py_ssize_t size;
    switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 0))
                return (*meth)(self, NULL);
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
                #endif
                result = (*meth)(self, arg0);
                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                Py_DECREF(arg0);
                #endif
                return result;
            }
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags in "
                        "__Pyx_CyFunction_Call. METH_OLDARGS is no "
                        "longer supported!");
        return NULL;
    }
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
        argc = PyTuple_GET_SIZE(args);
        new_args = PyTuple_GetSlice(args, 1, argc);
        if (unlikely(!new_args))
            return NULL;
        self = PyTuple_GetItem(args, 0);
        if (unlikely(!self)) {
            Py_DECREF(new_args);
            return NULL;
        }
        result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
        Py_DECREF(new_args);
    } else {
        result = __Pyx_CyFunction_Call(func, args, kw);
    }
    return result;
}
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
    0,
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    (reprfunc) __Pyx_CyFunction_repr,
    0,
    0,
    0,
    0,
    __Pyx_CyFunction_CallAsMethod,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
    0,
    (traverseproc) __Pyx_CyFunction_traverse,
    (inquiry) __Pyx_CyFunction_clear,
    0,
#if PY_VERSION_HEX < 0x030500A0
    offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
    offsetof(PyCFunctionObject, m_weakreflist),
#endif
    0,
    0,
    __pyx_CyFunction_methods,
    __pyx_CyFunction_members,
    __pyx_CyFunction_getsets,
    0,
    0,
    __Pyx_CyFunction_descr_get,
    0,
    offsetof(__pyx_CyFunctionObject, func_dict),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
    0,
#endif
};
static int __pyx_CyFunction_init(void) {
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
    if (unlikely(__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_Malloc(size);
    if (unlikely(!m->defaults))
        return PyErr_NoMemory();
    memset(m->defaults, 0, size);
    m->defaults_pyobjects = pyobjects;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

/* BytesEquals */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result;
#if CYTHON_USE_UNICODE_INTERNALS
            Py_hash_t hash1, hash2;
            hash1 = ((PyBytesObject*)s1)->ob_shash;
            hash2 = ((PyBytesObject*)s2)->ob_shash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                return (equals == Py_NE);
            }
#endif
            result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

/* UnicodeEquals */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
#if PY_MAJOR_VERSION < 3
    PyObject* owned_ref = NULL;
#endif
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
#if PY_MAJOR_VERSION < 3
    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
        owned_ref = PyUnicode_FromObject(s2);
        if (unlikely(!owned_ref))
            return -1;
        s2 = owned_ref;
        s2_is_unicode = 1;
    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
        owned_ref = PyUnicode_FromObject(s1);
        if (unlikely(!owned_ref))
            return -1;
        s1 = owned_ref;
        s1_is_unicode = 1;
    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
        return __Pyx_PyBytes_Equals(s1, s2, equals);
    }
#endif
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length;
        int kind;
        void *data1, *data2;
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
            goto return_ne;
        }
#if CYTHON_USE_UNICODE_INTERNALS
        {
            Py_hash_t hash1, hash2;
        #if CYTHON_PEP393_ENABLED
            hash1 = ((PyASCIIObject*)s1)->hash;
            hash2 = ((PyASCIIObject*)s2)->hash;
        #else
            hash1 = ((PyUnicodeObject*)s1)->hash;
            hash2 = ((PyUnicodeObject*)s2)->hash;
        #endif
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                goto return_ne;
            }
        }
#endif
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        #if PY_MAJOR_VERSION < 3
        Py_XDECREF(owned_ref);
        #endif
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_EQ);
return_ne:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_NE);
#endif
}

/* 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;
    }
}

/* PyFloatBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyFloat_TrueDivideObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check) {
    const double b = floatval;
    double a, result;
    (void)inplace;
    (void)zerodivision_check;
    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 ? PyNumber_InPlaceTrueDivide : PyNumber_TrueDivide)(op1, op2);
    }
        
        PyFPE_START_PROTECT("divide", return NULL)
        result = a / b;
        PyFPE_END_PROTECT(result)
        return PyFloat_FromDouble(result);
}
#endif

/* None */
  static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

/* UnpackUnboundCMethod */
  static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
    PyObject *method;
    method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
    if (unlikely(!method))
        return -1;
    target->method = method;
#if CYTHON_COMPILING_IN_CPYTHON
    #if PY_MAJOR_VERSION >= 3
    if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
    #endif
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
        target->func = descr->d_method->ml_meth;
        target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS);
    }
#endif
    return 0;
}

/* CallUnboundCMethod1 */
  #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) {
    if (likely(cfunc->func)) {
        int flag = cfunc->flag;
        if (flag == METH_O) {
            return (*(cfunc->func))(self, arg);
        } else if (PY_VERSION_HEX >= 0x030600B1 && flag == METH_FASTCALL) {
            if (PY_VERSION_HEX >= 0x030700A0) {
                return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1);
            } else {
                return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
            }
        } else if (PY_VERSION_HEX >= 0x030700A0 && flag == (METH_FASTCALL | METH_KEYWORDS)) {
            return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
        }
    }
    return __Pyx__CallUnboundCMethod1(cfunc, self, arg);
}
#endif
static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        args = PyTuple_New(1);
        if (unlikely(!args)) goto bad;
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 0, arg);
        if (cfunc->flag & METH_KEYWORDS)
            result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
        else
            result = (*cfunc->func)(self, args);
    } else {
        args = PyTuple_New(2);
        if (unlikely(!args)) goto bad;
        Py_INCREF(self);
        PyTuple_SET_ITEM(args, 0, self);
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 1, arg);
        result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    }
#else
    args = PyTuple_Pack(2, self, arg);
    if (unlikely(!args)) goto bad;
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
#endif
bad:
    Py_XDECREF(args);
    return result;
}

/* decode_c_bytes */
  static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
         const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
    if (unlikely((start < 0) | (stop < 0))) {
        if (start < 0) {
            start += length;
            if (start < 0)
                start = 0;
        }
        if (stop < 0)
            stop += length;
    }
    if (stop > length)
        stop = length;
    length = stop - start;
    if (unlikely(length <= 0))
        return PyUnicode_FromUnicode(NULL, 0);
    cstring += start;
    if (decode_func) {
        return decode_func(cstring, length, errors);
    } else {
        return PyUnicode_Decode(cstring, length, encoding, errors);
    }
}

/* 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;
}

/* PyObjectFormatAndDecref */
  static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
    if (unlikely(!s)) return NULL;
    if (likely(PyUnicode_CheckExact(s))) return s;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyString_CheckExact(s))) {
        PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict");
        Py_DECREF(s);
        return result;
    }
    #endif
    return __Pyx_PyObject_FormatAndDecref(s, f);
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
    PyObject *result = PyObject_Format(s, f);
    Py_DECREF(s);
    return result;
}

/* JoinPyUnicode */
  static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      CYTHON_UNUSED Py_UCS4 max_char) {
#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyObject *result_uval;
    int result_ukind;
    Py_ssize_t i, char_pos;
    void *result_udata;
#if CYTHON_PEP393_ENABLED
    result_uval = PyUnicode_New(result_ulength, max_char);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
    result_udata = PyUnicode_DATA(result_uval);
#else
    result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = sizeof(Py_UNICODE);
    result_udata = PyUnicode_AS_UNICODE(result_uval);
#endif
    char_pos = 0;
    for (i=0; i < value_count; i++) {
        int ukind;
        Py_ssize_t ulength;
        void *udata;
        PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
        if (unlikely(__Pyx_PyUnicode_READY(uval)))
            goto bad;
        ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
        if (unlikely(!ulength))
            continue;
        if (unlikely(char_pos + ulength < 0))
            goto overflow;
        ukind = __Pyx_PyUnicode_KIND(uval);
        udata = __Pyx_PyUnicode_DATA(uval);
        if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
            memcpy((char *)result_udata + char_pos * result_ukind, udata, (size_t) (ulength * result_ukind));
        } else {
            #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
            _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
            #else
            Py_ssize_t j;
            for (j=0; j < ulength; j++) {
                Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
                __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
            }
            #endif
        }
        char_pos += ulength;
    }
    return result_uval;
overflow:
    PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
bad:
    Py_DECREF(result_uval);
    return NULL;
#else
    result_ulength++;
    value_count++;
    return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
#endif
}

/* PyIntBinop */
  #if !CYTHON_COMPILING_IN_PYPY
#if PY_MAJOR_VERSION < 3 || CYTHON_USE_PYLONG_INTERNALS
#define __Pyx_PyInt_FloorDivideObjC_ZeroDivisionError(operand)\
    if (unlikely(zerodivision_check && ((operand) == 0))) {\
        PyErr_SetString(PyExc_ZeroDivisionError, "integer division by zero");\
        return NULL;\
    }
#endif
static PyObject* __Pyx_PyInt_FloorDivideObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            __Pyx_PyInt_FloorDivideObjC_ZeroDivisionError(b)
            if (unlikely(b == -1 && ((unsigned long)a) == 0-(unsigned long)a))
                return PyInt_Type.tp_as_number->nb_floor_divide(op1, op2);
            else {
                long q, r;
                q = a / b;
                r = a - q*b;
                q -= ((r != 0) & ((r ^ b) < 0));
                x = q;
            }
            return PyInt_FromLong(x);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_floor_divide(op1, op2);
            }
        }
                __Pyx_PyInt_FloorDivideObjC_ZeroDivisionError(b)
                {
                    long q, r;
                    q = a / b;
                    r = a - q*b;
                    q -= ((r != 0) & ((r ^ b) < 0));
                    x = q;
                }
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                {
                    PY_LONG_LONG q, r;
                    q = lla / llb;
                    r = lla - q*llb;
                    q -= ((r != 0) & ((r ^ llb) < 0));
                    llx = q;
                }
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    return (inplace ? PyNumber_InPlaceFloorDivide : PyNumber_FloorDivide)(op1, op2);
}
#endif

/* 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;
}

/* StringJoin */
  #if !CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
    return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL);
}
#endif

/* FastTypeChecks */
  #if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = a->tp_base;
        if (a == b)
            return 1;
    }
    return b == &PyBaseObject_Type;
}
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (a == b) return 1;
    mro = a->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(a, b);
}
#if PY_MAJOR_VERSION == 2
static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
    PyObject *exception, *value, *tb;
    int res;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&exception, &value, &tb);
    res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
    if (unlikely(res == -1)) {
        PyErr_WriteUnraisable(err);
        res = 0;
    }
    if (!res) {
        res = PyObject_IsSubclass(err, exc_type2);
        if (unlikely(res == -1)) {
            PyErr_WriteUnraisable(err);
            res = 0;
        }
    }
    __Pyx_ErrRestore(exception, value, tb);
    return res;
}
#else
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
    if (!res) {
        res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
    return res;
}
#endif
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    assert(PyExceptionClass_Check(exc_type));
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        #if PY_MAJOR_VERSION < 3
        if (likely(exc_type == t)) return 1;
        #endif
        if (likely(PyExceptionClass_Check(t))) {
            if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
        } else {
        }
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        if (likely(PyExceptionClass_Check(exc_type))) {
            return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
        } else if (likely(PyTuple_Check(exc_type))) {
            return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
        } else {
        }
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    assert(PyExceptionClass_Check(exc_type1));
    assert(PyExceptionClass_Check(exc_type2));
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* SwapException */
  #if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = *type;
    exc_info->exc_value = *value;
    exc_info->exc_traceback = *tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = *type;
    tstate->exc_value = *value;
    tstate->exc_traceback = *tb;
    #endif
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#endif

/* None */
  static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* PyIntCompare */
  static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
    if (op1 == op2) {
        Py_RETURN_FALSE;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        if (a != b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = Py_SIZE(op1);
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        if (intval == 0) {
            if (size != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
        } else if (intval < 0) {
            if (size >= 0)
                Py_RETURN_TRUE;
            intval = -intval;
            size = -size;
        } else {
            if (size <= 0)
                Py_RETURN_TRUE;
        }
        uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 4)) {
            unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 3)) {
            unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 2)) {
            unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 1)) {
            unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
            unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
        if (unequal != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
        if ((double)a != (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    return (
        PyObject_RichCompare(op1, op2, Py_NE));
}

/* 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;
}

/* 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

/* 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;
}

/* ClassMethod */
  static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM <= 0x05080000
    if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) {
        return PyClassMethod_New(method);
    }
#else
#if CYTHON_COMPILING_IN_PYSTON || CYTHON_COMPILING_IN_PYPY
    if (PyMethodDescr_Check(method))
#else
    static PyTypeObject *methoddescr_type = NULL;
    if (methoddescr_type == NULL) {
       PyObject *meth = PyObject_GetAttrString((PyObject*)&PyList_Type, "append");
       if (!meth) return NULL;
       methoddescr_type = Py_TYPE(meth);
       Py_DECREF(meth);
    }
    if (__Pyx_TypeCheck(method, methoddescr_type))
#endif
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject *)method;
        #if PY_VERSION_HEX < 0x03020000
        PyTypeObject *d_type = descr->d_type;
        #else
        PyTypeObject *d_type = descr->d_common.d_type;
        #endif
        return PyDescr_NewClassMethod(d_type, descr->d_method);
    }
#endif
    else if (PyMethod_Check(method)) {
        return PyClassMethod_New(PyMethod_GET_FUNCTION(method));
    }
    else if (PyCFunction_Check(method)) {
        return PyClassMethod_New(method);
    }
#ifdef __Pyx_CyFunction_USED
    else if (__Pyx_CyFunction_Check(method)) {
        return PyClassMethod_New(method);
    }
#endif
    PyErr_SetString(PyExc_TypeError,
                   "Class-level classmethod() can only be called on "
                   "a method_descriptor or instance method.");
    return NULL;
}

/* GetNameInClass */
  static PyObject *__Pyx_GetGlobalNameAfterAttributeLookup(PyObject *name) {
    PyObject *result;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        return NULL;
    __Pyx_PyErr_Clear();
    __Pyx_GetModuleGlobalNameUncached(result, name);
    return result;
}
static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) {
    PyObject *result;
    result = __Pyx_PyObject_GetAttrStr(nmspace, name);
    if (!result) {
        result = __Pyx_GetGlobalNameAfterAttributeLookup(name);
    }
    return result;
}

/* CLineInTraceback */
  #ifndef CYTHON_CLINE_IN_TRACEBACK
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
    PyObject *use_cline;
    PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject **cython_runtime_dict;
#endif
    if (unlikely(!__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
#if CYTHON_COMPILING_IN_CPYTHON
    cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, *cython_runtime_dict,
            __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
    } else
#endif
    {
      PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
      if (use_cline_obj) {
        use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
        Py_DECREF(use_cline_obj);
      } else {
        PyErr_Clear();
        use_cline = NULL;
      }
    }
    if (!use_cline) {
        c_line = 0;
        PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
    }
    else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache */
  static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

/* AddTraceback */
  #include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

/* CIntFromPyVerify */
  #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type(enum  arrow::Type::type value) {
    const enum  arrow::Type::type neg_one = (enum  arrow::Type::type) ((enum  arrow::Type::type) 0 - (enum  arrow::Type::type) 1), const_zero = (enum  arrow::Type::type) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum  arrow::Type::type) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum  arrow::Type::type) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum  arrow::Type::type) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(enum  arrow::Type::type) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum  arrow::Type::type) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(enum  arrow::Type::type),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____arrow_3a__3a_UnionMode_3a__3a_type(enum  arrow::UnionMode::type value) {
    const enum  arrow::UnionMode::type neg_one = (enum  arrow::UnionMode::type) ((enum  arrow::UnionMode::type) 0 - (enum  arrow::UnionMode::type) 1), const_zero = (enum  arrow::UnionMode::type) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum  arrow::UnionMode::type) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum  arrow::UnionMode::type) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum  arrow::UnionMode::type) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(enum  arrow::UnionMode::type) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum  arrow::UnionMode::type) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(enum  arrow::UnionMode::type),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
    const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) {
    const int64_t neg_one = (int64_t) ((int64_t) 0 - (int64_t) 1), const_zero = (int64_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int64_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int64_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int64_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int64_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_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_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_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_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(6); 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);
    member = __Pyx_PyBool_FromLong(s.deduplicate_objects); if (unlikely(!member)) goto bad;
    if (unlikely(PyDict_SetItem(res, __pyx_n_s_deduplicate_objects, 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
#if PY_VERSION_HEX >= 0x030800b1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
    0,
#endif
};
static int __pyx_Generator_init(void) {
    __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
    __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
    if (unlikely(!__pyx_GeneratorType)) {
        return -1;
    }
    return 0;
}

/* CheckBinaryVersion */
  static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

/* FunctionExport */
  static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__");
    if (!d) {
        PyErr_Clear();
        d = PyDict_New();
        if (!d)
            goto bad;
        Py_INCREF(d);
        if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0)
            goto bad;
    }
    tmp.fp = f;
#if PY_VERSION_HEX >= 0x02070000
    cobj = PyCapsule_New(tmp.p, sig, 0);
#else
    cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0);
#endif
    if (!cobj)
        goto bad;
    if (PyDict_SetItemString(d, name, cobj) < 0)
        goto bad;
    Py_DECREF(cobj);
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(cobj);
    Py_XDECREF(d);
    return -1;
}

/* InitStrings */
  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        if (PyObject_Hash(*t->p) == -1)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
#if !CYTHON_PEP393_ENABLED
static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    char* defenc_c;
    PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
    if (!defenc) return NULL;
    defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    {
        char* end = defenc_c + PyBytes_GET_SIZE(defenc);
        char* c;
        for (c = defenc_c; c < end; c++) {
            if ((unsigned char) (*c) >= 128) {
                PyUnicode_AsASCIIString(o);
                return NULL;
            }
        }
    }
#endif
    *length = PyBytes_GET_SIZE(defenc);
    return defenc_c;
}
#else
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    if (likely(PyUnicode_IS_ASCII(o))) {
        *length = PyUnicode_GET_LENGTH(o);
        return PyUnicode_AsUTF8(o);
    } else {
        PyUnicode_AsASCIIString(o);
        return NULL;
    }
#else
    return PyUnicode_AsUTF8AndSize(o, length);
#endif
}
#endif
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
    int retval;
    if (unlikely(!x)) return -1;
    retval = __Pyx_PyObject_IsTrue(x);
    Py_DECREF(x);
    return retval;
}
static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
#if PY_MAJOR_VERSION >= 3
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type %.200s).  "
                "The ability to return an instance of a strict subclass of int "
                "is deprecated, and may be removed in a future version of Python.",
                Py_TYPE(result)->tp_name)) {
            Py_DECREF(result);
            return NULL;
        }
        return result;
    }
#endif
    PyErr_Format(PyExc_TypeError,
                 "__%.4s__ returned non-%.4s (type %.200s)",
                 type_name, type_name, Py_TYPE(result)->tp_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_Check(x) || PyLong_Check(x)))
#else
  if (likely(PyLong_Check(x)))
#endif
    return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  #if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = m->nb_int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = m->nb_long(x);
  }
  #else
  if (likely(m && m->nb_int)) {
    name = "int";
    res = m->nb_int(x);
  }
  #endif
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
    res = PyNumber_Int(x);
  }
#endif
  if (likely(res)) {
#if PY_MAJOR_VERSION < 3
    if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
#else
    if (unlikely(!PyLong_CheckExact(res))) {
#endif
        return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(b);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
